data/full_repos/permissive/158984095/Homework4/Question2_FFT/matlabFFT.v
1: b'%Warning-STMTDLY: data/full_repos/permissive/158984095/Homework4/Question2_FFT/matlabFFT.v:25: Unsupported: Ignoring delay on this delayed statement.\n# 5 clk=~clk;\n^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/158984095/Homework4/Question2_FFT/matlabFFT.v:34: Unsupported: Ignoring delay on this delayed statement.\n#5;\n^\n%Warning-STMTDLY: data/full_repos/permissive/158984095/Homework4/Question2_FFT/matlabFFT.v:37: Unsupported: Ignoring delay on this delayed statement.\n#10;\n^\n%Error: data/full_repos/permissive/158984095/Homework4/Question2_FFT/matlabFFT.v:38: Unsupported: Seeding $random doesn\'t map to C++, use $c("srand")\na_r=$random($time) % (2000); \n    ^~~~~~~\n%Error: Internal Error: data/full_repos/permissive/158984095/Homework4/Question2_FFT/matlabFFT.v:38: ../V3Ast.cpp:358: Null item passed to setOp1p\na_r=$random($time) % (2000); \n                   ^\n                        ... See the manual and https://verilator.org for more assistance.\n'
module matlabgenFFT_pipe();

reg clk;
reg [15:0] a_i;
reg [15:0] a_r;
reg [15:0] b_i;
reg [15:0] b_r;
reg [11:0] wn_exp;
reg reset;
wire [15:0] x_r;
wire [15:0] x_i;
wire [15:0] y_r;
wire [15:0] y_i;
wire [1:0] state;


integer i,f;
FFT_pipe matlab_FFT(clk,wn_exp,a_r,a_i,b_r,b_i,reset,x_r,x_i,y_r,y_i,state);


initial begin
clk=1'b1;
forever begin
# 5 clk=~clk;
end
end


initial begin
f=$fopen("FFT_pipe.m","w");
$display("Start !");
reset=1'b1;
#5;
reset=1'b0;
for (i=1;i<100;i=i+1) begin
#10;
a_r=$random($time) % (2000); 
a_i=$random($time) % (2000);
b_r=$random($time) % (2000);
b_i=$random($time) % (2000);
wn_exp=12'b101010101010;
$fwrite(f,"wn_exp(%d)=%d;a_r(%d)=%d;a_i(%d)=%d;b_r(%d)=%d;b_i(%d)=%d;x_r(%d)=%d;x_i(%d)=%d;y_r(%d)=%d;y_i(%d)=%d;\n",i,wn_exp,i,$signed(a_r),i,$signed(a_i),i,$signed(b_r),i,$signed(b_i),i,$signed(x_r),i,$signed(x_i),i,$signed(y_r),i,$signed(y_i));  
$display($time,"wn_exp(%d)=%d;a_r(%d)=%d;a_i(%d)=%d;b_r(%d)=%d;b_i(%d)=%d;x_r(%d)=%d;x_i(%d)=%d;y_r(%d)=%d;y_i(%d)=%d;state(%d)=%d\n",i,wn_exp,i,$signed(a_r),i,$signed(a_i),i,$signed(b_r),i,$signed(b_i),i,$signed(x_r),i,$signed(x_i),i,$signed(y_r),i,$signed(y_i),i,state);  
end
$fclose(f);
end

endmodule
module matlabgenFFT_pipe();


reg clk;
reg [15:0] a_i;
reg [15:0] a_r;
reg [15:0] b_i;
reg [15:0] b_r;
reg [11:0] wn_exp;
reg reset;
wire [15:0] x_r;
wire [15:0] x_i;
wire [15:0] y_r;
wire [15:0] y_i;
wire [1:0] state;


integer i,f;
FFT_pipe matlab_FFT(clk,wn_exp,a_r,a_i,b_r,b_i,reset,x_r,x_i,y_r,y_i,state);


initial begin
clk=1'b1;
forever begin
# 5 clk=~clk;
end
end


initial begin
f=$fopen("FFT_pipe.m","w");
$display("Start !");
reset=1'b1;
#5;
reset=1'b0;
for (i=1;i<100;i=i+1) begin
#10;
a_r=$random($time) % (2000); 
a_i=$random($time) % (2000);
b_r=$random($time) % (2000);
b_i=$random($time) % (2000);
wn_exp=12'b101010101010;
$fwrite(f,"wn_exp(%d)=%d;a_r(%d)=%d;a_i(%d)=%d;b_r(%d)=%d;b_i(%d)=%d;x_r(%d)=%d;x_i(%d)=%d;y_r(%d)=%d;y_i(%d)=%d;\n",i,wn_exp,i,$signed(a_r),i,$signed(a_i),i,$signed(b_r),i,$signed(b_i),i,$signed(x_r),i,$signed(x_i),i,$signed(y_r),i,$signed(y_i));  
$display($time,"wn_exp(%d)=%d;a_r(%d)=%d;a_i(%d)=%d;b_r(%d)=%d;b_i(%d)=%d;x_r(%d)=%d;x_i(%d)=%d;y_r(%d)=%d;y_i(%d)=%d;state(%d)=%d\n",i,wn_exp,i,$signed(a_r),i,$signed(a_i),i,$signed(b_r),i,$signed(b_i),i,$signed(x_r),i,$signed(x_i),i,$signed(y_r),i,$signed(y_i),i,state);  
end
$fclose(f);
end

endmodule