Eugene
|
I do this all the time, in both directions. If you have already run the simulation, you can use the waveform calculator's "printvs" command to display the data. You will have to change the format from engineering to scientific units. You then click the "print" command and print to a file. You can only print 1000 or so points this way. For more points, you have to use the command line.
I prefer creating the file with VerilogA. I've included a piece of VerilogA code I use to create files. In Matlab, read the data in with aa=load('IinputCol'); You will have to make sure the path to the directory is in your Matlab path.
//=================================
`include "constants.h" `include "discipline.h"
module write1(in); input in; electrical in;
parameter real sample_rate = 1e6 from (0:inf]; parameter integer record = 1 from [0:1]; // 1 = record, 0 = don't. integer fptr; real period;
analog begin @ ( initial_step ) begin if (record ==1) begin fptr = $fopen("/home/rcvr_5GHz/IinputCol"); end period = 1/sample_rate; end
if (record == 0) period = 1e6; @(timer(0, period)) begin if(record == 1) $fstrobe(fptr, "%g", V(in)); end
@ (final_step) begin $fclose(fptr); end end endmodule
|