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.

Verilog & System Verilog - port sizing by inheritance

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
Hello,

VHDL supports leaving the size of component ports unconstrained during declaration.
Unconstrained ports are constrained during elaboration by inheriting the sizes of the signals we connect to them.

Example:
Code:
signal some_signal : std_logic_vector ( 7 downto 0 ) ;

instantiation_of_some_entity : some_entity 
(
  some_port => some_signal
) ;

--some_entity could have been declared as: 

entity some_entity is
port 
(
  some_port : std_logic_vector ( 7 downto 0 ) ; some_port is constrained
) ;
end entity some_entity ;

--some_entity could have also been declared as: 

entity some_entity is
port 
(
  some_port : std_logic_vector -- some_port is unconstrained
) ;
end entity some_entity ;

Questions:
1. Does Verilog support this?
2. Does System Verilog support this?
 

Verilog does not support this. SystemVerilog has dynamically sized unpacked arrays, but nothing for packed arrays (vectors).

What you can do is pass the size of a port as a module parameter, and use that parameter to size the port.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top