amsverif
Newbie level 2
- Joined
- Dec 4, 2012
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,302
Hi All,
I am creating a task in verilog that works similar to $signal_force verilog system task.
But with a lesser number of arguments i.e. - Signal to force, value to be forced and the time at which the value is to be forced.
As its not working for me I am working with 2 arguments - Signal to force, value to be forced.
My test case calls this task as
my_signal_force (Top.X1.X2.sig, 1'b0); // The signal can be bus also
Task definition -
task my_signal_force;
input reg [8*10:0] string;
input [31:0] val;
begin
$display("PRINT THE SIGNAL = %s \n", string);
force string = val;
$display("PRINT THE SIGNAL NOW= %s \n", string);
end
endtask
My main concern is if I take the first argument as wire and define as "input string;" . Verilog will not understand that the way I intend to as the signal is anyways a set of characters. So, I have to anyways take the first arg as string.
Now, how to force the signal with a value here ? How to get the signal forced in the force statement when I receive the left hand side as a string. The first display statement displays the signal path. But second doesn't diplay anything as it accepts the value 00000 ....
Can anyone help?
I am creating a task in verilog that works similar to $signal_force verilog system task.
But with a lesser number of arguments i.e. - Signal to force, value to be forced and the time at which the value is to be forced.
As its not working for me I am working with 2 arguments - Signal to force, value to be forced.
My test case calls this task as
my_signal_force (Top.X1.X2.sig, 1'b0); // The signal can be bus also
Task definition -
task my_signal_force;
input reg [8*10:0] string;
input [31:0] val;
begin
$display("PRINT THE SIGNAL = %s \n", string);
force string = val;
$display("PRINT THE SIGNAL NOW= %s \n", string);
end
endtask
My main concern is if I take the first argument as wire and define as "input string;" . Verilog will not understand that the way I intend to as the signal is anyways a set of characters. So, I have to anyways take the first arg as string.
Now, how to force the signal with a value here ? How to get the signal forced in the force statement when I receive the left hand side as a string. The first display statement displays the signal path. But second doesn't diplay anything as it accepts the value 00000 ....
Can anyone help?