Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

HOWTO: implement inferring ROM with registered output in m9k from HDL code?

Hi,

In Quartus II web edition 9.1, I inserted a template:


module rom_test_inf
# (parameter DATA_WIDTH=8, parameter ADDR_WIDTH=10)
(
	input  addr,
	input clk, 
	output reg  q
);
	// Declare the ROM variable
	reg  rom;
	initial
	begin
		$readmemb("rom_init_file.txt", rom);
	end
	always @ (posedge clk)
	begin
		q <= rom;
	end
endmodule

the registers of output were NOT in m9k as I expected, but extra registers.

as attachments.

the last figure is what I want while it was implemented from megafunction.

but how from HDL code?

thanks

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Your apparently refering to RTL view. As far as I know, all Quartus internal ROM/RAM needs at least one register (either implemented as address or output register). Because the template uses only one register level, Quartus can't but implement the register in the RAM/ROM block, whatever the RTL view tells. So if the ROM is infered at all, everything should be O.K.