VHDL Parameter declaration

Status
Not open for further replies.

hareeshP

Member level 3
Joined
Jul 19, 2017
Messages
59
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Visit site
Activity points
491
hi,
below is the verilog code


Code Verilog - [expand]
1
parameter   RST_hold_time = 32'd16384 ;



can we define the above in vhdl like this??


Code VHDL - [expand]
1
constant RST_hold_time  : real := 16384

 

Why are you using a real constant in place of a Verilog unsigned value with width specification? An unsigned or integer constants seems more suitable at first sight.

Secondly your real constant involves a syntax error.
16384.0 would be a valid real value.

Suggest to pre check your VHDL code ideas with a compiler or simulator tool before posting.
 

A verilog parameter (that translates to a "module parametrization value") can be translated into an architecture-local constant. In most cases, generics on entities are probably a closer match, however (as these are used to parametrize these entities at instantiation time).
 

It really depends on the the application, as FvM has pointed out in #2.

constant RST_hold_time : integer range 0 to 16384 := 16384 ;

Declaring it as unsigned will have more flexibility.

As I have been seeing some of your recent posts:
1. Learn one language thoroughly before attempting VHDL <--> Verilog conversions.
2. There are tools/sw for compiling/simulating RTL. Use it! Please stop using EDA board as the compiler.
 
As I have been seeing some of your recent posts:
1. Learn one language thoroughly before attempting VHDL <--> Verilog conversions.
2. There are tools/sw for compiling/simulating RTL. Use it! Please stop using EDA board as the compiler.

I've already pointed #1 out in one of their other threads.

As you indicated previously you are learning VHDL, so stop posting Verilog code that you want to convert. You should not even be looking at Verilog code. What you are doing is making it harder to learn VHDL by confusing yourself. e.g. you have regularly used the wrong language syntax when posting code samples, some_bus(2:3) a mix of VHDL and Verilog syntax.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…