Mar 14, 2013 #1 A anne rachel Junior Member level 2 Joined Jan 11, 2011 Messages 20 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,283 Activity points 1,435 I am not able to simulate a verilog code where i am reading the input values from a .txt file.Kindly help me in solving dis issue.... Thanks in advance....
I am not able to simulate a verilog code where i am reading the input values from a .txt file.Kindly help me in solving dis issue.... Thanks in advance....
Mar 14, 2013 #2 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,500 Helped 14,757 Reputation 29,796 Reaction score 14,124 Trophy points 1,393 Location Bochum, Germany Activity points 298,441 I guess, you should start with showing your code.
Mar 15, 2013 #3 A anne rachel Junior Member level 2 Joined Jan 11, 2011 Messages 20 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,283 Activity points 1,435 the code is quite big ..this is the piece of code which reads values from the file... module data_mem(index,A,B); input wire[0:2] index; output reg[0:128] A; output reg[0:128] B; reg [0:128] dmem[0:4]; initial $readmemb("data.txt", dmem); always @(index) begin A<=dmem[index]; B<=dmem[index+1]; end
the code is quite big ..this is the piece of code which reads values from the file... module data_mem(index,A,B); input wire[0:2] index; output reg[0:128] A; output reg[0:128] B; reg [0:128] dmem[0:4]; initial $readmemb("data.txt", dmem); always @(index) begin A<=dmem[index]; B<=dmem[index+1]; end