FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-27-2009, 07:21 PM
PrAsHaNtH@IIT
Guest
 
Posts: n/a
Default Error in Verilog Code

hi

module test_readmemory(
);

reg [0:7] mem [1:30];
initial
$readmemb("memory.mem",mem);

always @(mem)
$display("mems= %b,%b,%h,%h", mem[1],mem[10],mem[15],mem[30]);
endmodule

The file memory.mem contains these data
209
210
211
211
212
212
212
211
211
212
213
213
213
213
213
212
213
213
213
213
212
213
212
212
212
213
212
211
211
211 While simulating this design in xilinx ise, some times I am
getting error "ERROR:Simulator - Failed to link the design. Check to
see if any previous simulation executables are still running."
what is this error. how to eliminate it.

and sometimes I am getting outputs 8'h09, 8'h12, 8'h13, 8'h11
In the input file, mem[1] = 209 but output i am getting is 8'h09
mem[10]=212 but output iam getting is 8'12
similarly mem[15] and mem[30].


8 binary numbers are sufficient to represent upto 256. But, why I am
getting like this??

Please let me know asap

thanks


Reply With Quote
  #2 (permalink)  
Old 05-27-2009, 08:50 PM
john
Guest
 
Posts: n/a
Default Re: Error in Verilog Code

On May 27, 11:21*am, "PrAsHaNtH@IIT" <[email protected]> wrote:
> hi
>
> module test_readmemory(
> * * );
>
> reg [0:7] mem [1:30];
> initial
> $readmemb("memory.mem",mem);
>
> always @(mem)
> $display("mems= %b,%b,%h,%h", mem[1],mem[10],mem[15],mem[30]);
> endmodule
>
> The file memory.mem contains these data
> 209
> 210
> 211
> 211
> 212
> 212
> 212
> 211
> 211
> 212
> 213
> 213
> 213
> 213
> 213
> 212
> 213
> 213
> 213
> 213
> 212
> 213
> 212
> 212
> 212
> 213
> 212
> 211
> 211
> 211 * *While simulating this design in xilinx ise, some times I am
> getting error "ERROR:Simulator - Failed to link the design. Check to
> see if any previous simulation executables are still running."
> *what is this error. how to eliminate it.
>
> and sometimes I am getting outputs 8'h09, 8'h12, 8'h13, 8'h11
> In the input file, mem[1] = 209 but output i am getting is 8'h09
> * * * * * * * * * * * *mem[10]=212 but output iam getting is 8'12
> similarly * * * * *mem[15] and mem[30].
>
> 8 binary numbers are sufficient to represent upto 256. But, why I am
> getting like this??
>
> Please let me know asap
>
> thanks


You need to look at the file format required by $readmemh and
$readmemb. As you might guess,
one reads hex values, the other reads binary values.

I can't help you with the Xilinx simulation error - I don't use that
simulator.

John Providenza
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Verilog Code PrAsHaNtH@IIT FPGA 1 04-25-2009 10:18 AM
Help with Verilog code flow + Code posted. dash82 Verilog 3 11-30-2007 10:13 PM
hi:please help me this code gives PARSE ERROR in ICARUS verilog indra Verilog 0 04-17-2007 10:57 AM
Looking for 64 bit IEEE802.3 Verilog code or tips for code Vik FPGA 2 12-28-2005 07:53 PM
Verilog Netlest Reader Code, ATPG Code Robert Posey Verilog 0 11-19-2003 11:41 PM


All times are GMT +1. The time now is 11:51 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved