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.

how to write output in file (in veriliog)

Status
Not open for further replies.

vinodh475

Newbie level 5
Newbie level 5
Joined
Sep 24, 2012
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,349
i am writing one verilog code
my number is 128 bit number and it will generate different number in every clock cycle
so i need to write each and every number in a file
can u please help me how can i do that?
 

Hi Vinod,
First open file using $fopen task in an initial block.
Then you can use $fdisplay task. Let's assume your number changes on rising edge of the clock, then I would read its value on falling edge
always @(negedge clk)
$fdisplay(fid1,"%d", theNumber);
Before ending simulation you'll need to close the file ID.

Start doing, debugging errors you will learn better, then using ready code.

Good luck!
 

    V

    Points: 2
    Helpful Answer Positive Rating
Go ogle a google? I am confused now.

Other than my increased level of confusion, seriously, try using google sometimes. This one is no worse than some other complacent posts on this forum, but sometimes ... Just for the fun of it I just did a cut & paste of "how to write output in file (in veriliog)" into google, and even that turns up pretty relevant answers.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top