In reply to stanzani:
Unlike VHDL, Verilog does not have a physical time type. The type realtime is identical to the type real.
When you write
1.5us, that literal constant get scaled to the current time unit, and it becomes just a value.
package A;
timeunit 1ns;
parameter realtime P1 = 1.5; //P1 has the value 1.5
parameter realtime P2 = 1.5us; //P2 has the value 1500.0
endpackage
package B;
timeunit 1ms;
parameter realtime P1 = 1.5; //P1 has the value 1.5
parameter realtime P2 = 1.5us; //P2 has the value 0.0015
endpackage
module M;
// does not matter what the time unit is here for the $displays
initial begin
$display(A::P1);// displays 1.5
$display(A::P2);// displays 1500.0
$display(B::P1);// displays 1.5
$display(B::P2);// displays 0.0015
end
endmodule
If you don’t define a time unit in the package, you are at the mercy of the tool’s default tune unit. (which I think should have been an error if not specified, but people are too lazy)