The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 16th, 2024, 2:16am
Pages: 1
Send Topic Print
how to write data of the bus in a text file using veriloga (Read 2908 times)
jovial
Junior Member
**
Offline



Posts: 19

how to write data of the bus in a text file using veriloga
Apr 25th, 2015, 6:51am
 
Hi all,
I am running a AMS simulation in Cadence virtuoso. My output from a block (in verilog code) is a bus of 19 bits.
I want to write a verilogA code to write the bus data (at every negative edge of clock) in a text file.

Can anyone help me with the code???
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: how to write data of the bus in a text file using veriloga
Reply #1 - Apr 28th, 2015, 2:37am
 
Jovial,
you can find the following example in the Verilog-A documentation from Cadence (which should be part of your installation)
Code:
module five_inputs( portbus );
  input [0:5] portbus;
  electrical [0:5] portbus;
...
endmodule 

Note that this is actually a 6-bit bus...
You can write to a file using Code:
$fopen, $fstrobe, $fdisplay, $fwrite, $fclose 


To find the edge, you can use the cross-event.
- B O E
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.