Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with assigning a generic

Status
Not open for further replies.

satty_008

Newbie level 5
Joined
Jan 4, 2013
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,388
I am relatively new to VHDL and am facing problems with generics. I want to assign a signal value to a generic .
Is it possible?
architecture rtl of entity_name is
signal ibaudratetop: integer;


component my_baud1 is
generic(
baudrate : integer := 115200;
clock_freq_mhz : real := 1.843200
);
port(
clk : in std_logic;
rst : in std_logic;
baud : out std_logic
);
end component;

begin
BAUDRATE: my_baud1
generic map(
baudrate =>ibaudratetop,
clock_freq_mhz => 1.843200
)
port map(
clk =>clk,
rst =>rst,
baud =>ibaudrx
);
end rtl

This is only a part of my UART code...Please have a look at the like which is in BOLD and help.Is that type of generic mapping possible where a signal which is of type integer is assigned to a generic.? I am unable to simulate the code. Thanks in advance !!:p:cool:
 

According to the nature of generics, this is not possible. Generics are supplying design parameters that must be completely known at compile time.

You can only assign a constant expression to baudrate, it might refer to other generics.
 

    V

    Points: 2
    Helpful Answer Positive Rating
According to the nature of generics, this is not possible. Generics are supplying design parameters that must be completely known at compile time.

You can only assign a constant expression to baudrate, it might refer to other generics.

Thanks a lot.. so you mean to say there is no way other than to assign a constant to generic
? :?::|:-(
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top