- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone!
I've created a project to test test lpm module. The simulation seems strange to me. The output of the lpm_rom has one clock period delay. For example, address 00 has content of "AEFF", 01 "BD11", 02 "CD12" etc, when the first rising edge of lpm_rom's clock comes, the output is not what expected "AEFF", it's "0000"; current address 02, but on the rising edge of clock, output is address "01"'s content, "BD11"! Seems to me it always gets the previous address content instead of current one! I've attached the design files, can someone explain it? // cnt4bit.v // address generator module cnt4bit(clk, rst, addr); input clk, rst; output [3:0] addr; reg [3:0] addr; always @( posedge clk or posedge rst) if(rst==1) addr <= 4'b0; else addr <= addr + 1'b1; endmodule https://www.alteraforum.com/forum/attachment.php?attachmentid=3078 https://www.alteraforum.com/forum/attachment.php?attachmentid=3079 https://www.alteraforum.com/forum/attachment.php?attachmentid=3080 https://www.alteraforum.com/forum/attachment.php?attachmentid=3081Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe your ROM module is registering both "addr" and "dout".
Thus, you get that delay.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- I believe your ROM module is registering both "addr" and "dout". Thus, you get that delay. --- Quote End --- yes, you're right! Just double checked the lpm_rom, I've enabled register q' output!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page