Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

why the keywords '$readmemb()' couldn't be recognized

Status
Not open for further replies.

jason_tian

Junior Member level 2
Joined
Jan 8, 2007
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,389
Hi all:
when I wanted to use a Verilog system task,'$readmemb()' to load data to a inherent table, the Quartus2 5.1 seemed couldn't recognize it and the keyword didn't turned blue. Why please?
 

Hi jason_tian,

Did you check if Quartus II 5.1 supports the $readmemb system task?

Start Quartus and open Help. Then search for "System Tasks and Functions Verilog". You can check if the 5.1 supports $readmemb.

This is a example which uses $readmemh and in Quartus II 6.1 it definitively works.

Code:
module ram_init(
					input clk_i, rst_i,
					input [5:0] addr_i,
					input [7:0] data_i,
					output [7:0] data_o
				);

//Initialize with Verilog HDL's $readmemb
reg [7:0] ram [0:63] /* synthesis ramstyle = "M512" */ ;

reg [5:0] addr_r;

initial 
begin
 $readmemh("ram.txt", ram);
end

always@( posedge clk_i or posedge rst_i)
	if(rst_i)
		addr_r <= 'd0;
	else
		addr_r <= addr_i;

always@( posedge clk_i)
	ram[addr_i] <= data_i;

assign data_o = ram[addr_r];

endmodule

mhmhmh
 

    jason_tian

    Points: 2
    Helpful Answer Positive Rating
dear mhmhmh:
Thanks a lot for your detailed reply that helped me a lot!
I've checked as you described and found:
'14.2
File Input-Output System Tasks
Not supported.
'
I'm clear now,thank you!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top