- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
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 copiato
2 Risposte
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
I believe your ROM module is registering both "addr" and "dout".
Thus, you get that delay.- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
--- 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!

Rispondere
Opzioni discussione
- Iscriversi a feed RSS
- Contrassegnare la discussione come nuova
- Contrassegnare la discussione come letta
- Sposta questo Discussione per l'utente corrente
- Preferito
- Iscriversi
- Pagina in versione di stampa