[SOLVED] How can I create calculable Time values in simulation VHDL codes?

Status
Not open for further replies.

Port Map

Advanced Member level 4
Joined
Aug 24, 2013
Messages
118
Helped
15
Reputation
30
Reaction score
14
Trophy points
1,298
Visit site
Activity points
2,089
I'm interested in using a calculable Time value in my simulation codes.
Like code below, I want to calculate parameter cDelay_ns from other defined values.
But this code not works, and brings the error below.

Plz tell me that how can I solve this problem?

code:
(91) constant gRs232Rate : real :=115.6;--Kbps
(92) constant iClk_period : time := 10 ns;
(93) constant cDelay_ns : integer :=integer(10.0 * 3.5 / gRs232Rate * 1.0e6 );
(94) constant cT3p5Delay : time := cDelay_ns ns;

error:
# ** Error: Test_Tb.vhd(94): near "ns": expecting ';'
 

constant cT3p5Delay : time := time( cDelay_ns );

Oh, That was very nice,... So thanks..
But where is the documents for learning something like this?

- - - Updated - - -

Oh, I tried this new code but not worked..

Code:
	constant gRs232Rate : real :=115.6;--Kbps
	constant iClk_period : time := 10 ns;
	constant cDelay_ns : integer :=integer(10.0 * 3.5 / gRs232Rate * 1.0e6 );
	constant cT3p5Delay : time := time( cDelay_ns );

Code:
# ** Error: Agc_Tb.vhd(92): Illegal type conversion from std.STANDARD.INTEGER to std.STANDARD.TIME (numeric to non-numeric).
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…