C
CupOfWater
Guest
Hi,
I'm wondering if I may be not using tasks correctly? I have some code
that is suppose to toggle certain signals at certain times to meet
timing specs for my device that I'm testing. I'm using modelsim 6.2
as the simulator.
`timescale 1ns/1ns
module flash_tb;
reg clk;
reg [7:0] io;
reg cle, ale, cebar, rebar, webar, wpbar, rbbar, dut_failure;
reg [7:0] cmd;
// cut some stuff out
task cmdlatch;
inout cle, cebar, webar, ale;
inout [7:0] io;
input [7:0] cmd;
begin
cle = 1; cebar = 0; webar = 1; ale = 0;
#10 begin
cle = 1; cebar = 0; webar = 0; ale = 0;
end
#5 begin
cle = 1; cebar = 0; webar = 0; ale = 0; io = cmd;
end
#20 begin
cle = 1; cebar = 0; webar = 1; ale = 0; io = cmd;
end
#10 begin
cle = 0; cebar = 1; webar = 1; ale = 1; io = 4'hz;
end
end
endtask
//cut some stuff out
initial begin
//initialize regs
cmdlatch(cle, cebar, webar, ale, io, cmd);
so in modelsim I'm expecting the waveforms to toggle, but instead the
signals are stuck on low. I also tried using "<=" inside the task,
but the situation does not change. Any help would be appreciated.
Thanks in advance.
Kevin
I'm wondering if I may be not using tasks correctly? I have some code
that is suppose to toggle certain signals at certain times to meet
timing specs for my device that I'm testing. I'm using modelsim 6.2
as the simulator.
`timescale 1ns/1ns
module flash_tb;
reg clk;
reg [7:0] io;
reg cle, ale, cebar, rebar, webar, wpbar, rbbar, dut_failure;
reg [7:0] cmd;
// cut some stuff out
task cmdlatch;
inout cle, cebar, webar, ale;
inout [7:0] io;
input [7:0] cmd;
begin
cle = 1; cebar = 0; webar = 1; ale = 0;
#10 begin
cle = 1; cebar = 0; webar = 0; ale = 0;
end
#5 begin
cle = 1; cebar = 0; webar = 0; ale = 0; io = cmd;
end
#20 begin
cle = 1; cebar = 0; webar = 1; ale = 0; io = cmd;
end
#10 begin
cle = 0; cebar = 1; webar = 1; ale = 1; io = 4'hz;
end
end
endtask
//cut some stuff out
initial begin
//initialize regs
cmdlatch(cle, cebar, webar, ale, io, cmd);
so in modelsim I'm expecting the waveforms to toggle, but instead the
signals are stuck on low. I also tried using "<=" inside the task,
but the situation does not change. Any help would be appreciated.
Thanks in advance.
Kevin