L
linuxczar
Guest
I AM NOT GETTING ANYOUTPUT FOR THE FOLLOWING PROGRAM AND ASSOCIATED
TESTBENCH . COULD ANY ONE DRAG ME OUTOF THIS PLZZ?
I JUST ATTATCHED SRAM.V AND IT'S TESTBENCH AND OUTPUT IN CADENCE
VERILOG-XL.
//module for SRAM single port
module sram(dataout,datain,address,enable,readwrite);
output [7:0] dataout;
input [7:0] datain;
input enable;
input readwrite;
input [7:0] address;
reg [7:0] dataout;
reg [7:0] memory [79:0];
always@( enable)
if (readwrite)
dataout <= memory[address];
else
memory[address]<=datain;
endmodule
//testbench for sram.v
module sram_tb;
reg [7:0] datain;
reg enable;
reg readwrite;
reg [7:0] address;
wire [7:0] dataout;
sram s1(dataout,datain,address,enable,readwrite);
initial
begin
$monitor($time,"enable=%b,readwrite=%b,address=%d,---,datain=
%d,dataout=%d",enable,readwrite,address,datain,dataout);
end
initial
begin
enable=0;readwrite=0;address=8'd0;datain=8'd0;
end
initial
begin
#5 enable=1'b1;readwrite=1'b0;address=8'd0;datain=8'd22;
#5 enable=1'b1;readwrite=1'b1;address=8'd0;
#5 enable=1'b1;readwrite=1'b0;address=8'd1;datain=8'd12;
#5 enable=1'b1;readwrite=1'b1;address=8'd1;
end
initial
begin
$recordfile("sram.trn");
$recordvars();
end
endmodule
the following output iam getting in CADENCE VERILOG-XL SIMULATOR
Compiling source file "sram.v"
Compiling source file "sram_tb.v"
Highest level modules:
sram_tb
0enable=0,readwrite=0,address= 0,---,datain=
0,dataout= x
5enable=1,readwrite=0,address= 0,---,datain=
22,dataout= x
10enable=1,readwrite=1,address= 0,---,datain=
22,dataout= x
15enable=1,readwrite=0,address= 1,---,datain=
12,dataout= x
20enable=1,readwrite=1,address= 1,---,datain=
12,dataout= x
0 simulation events (use +profile or +listcounts option to count)
CPU time: 0.1 secs to compile + 0.1 secs to link + 0.1 secs in
simulation
End of Tool: VERILOG-XL 05.60.001-p Mar 14, 2007 14:29:59
THANKS AND REGARDS
GKREDDYBH.
TESTBENCH . COULD ANY ONE DRAG ME OUTOF THIS PLZZ?
I JUST ATTATCHED SRAM.V AND IT'S TESTBENCH AND OUTPUT IN CADENCE
VERILOG-XL.
//module for SRAM single port
module sram(dataout,datain,address,enable,readwrite);
output [7:0] dataout;
input [7:0] datain;
input enable;
input readwrite;
input [7:0] address;
reg [7:0] dataout;
reg [7:0] memory [79:0];
always@( enable)
if (readwrite)
dataout <= memory[address];
else
memory[address]<=datain;
endmodule
//testbench for sram.v
module sram_tb;
reg [7:0] datain;
reg enable;
reg readwrite;
reg [7:0] address;
wire [7:0] dataout;
sram s1(dataout,datain,address,enable,readwrite);
initial
begin
$monitor($time,"enable=%b,readwrite=%b,address=%d,---,datain=
%d,dataout=%d",enable,readwrite,address,datain,dataout);
end
initial
begin
enable=0;readwrite=0;address=8'd0;datain=8'd0;
end
initial
begin
#5 enable=1'b1;readwrite=1'b0;address=8'd0;datain=8'd22;
#5 enable=1'b1;readwrite=1'b1;address=8'd0;
#5 enable=1'b1;readwrite=1'b0;address=8'd1;datain=8'd12;
#5 enable=1'b1;readwrite=1'b1;address=8'd1;
end
initial
begin
$recordfile("sram.trn");
$recordvars();
end
endmodule
the following output iam getting in CADENCE VERILOG-XL SIMULATOR
Compiling source file "sram.v"
Compiling source file "sram_tb.v"
Highest level modules:
sram_tb
0enable=0,readwrite=0,address= 0,---,datain=
0,dataout= x
5enable=1,readwrite=0,address= 0,---,datain=
22,dataout= x
10enable=1,readwrite=1,address= 0,---,datain=
22,dataout= x
15enable=1,readwrite=0,address= 1,---,datain=
12,dataout= x
20enable=1,readwrite=1,address= 1,---,datain=
12,dataout= x
0 simulation events (use +profile or +listcounts option to count)
CPU time: 0.1 secs to compile + 0.1 secs to link + 0.1 secs in
simulation
End of Tool: VERILOG-XL 05.60.001-p Mar 14, 2007 14:29:59
THANKS AND REGARDS
GKREDDYBH.