FpgaEE
Newbie level 1
- Joined
- Apr 30, 2013
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,305
Hi all,
I'm not a new designer but am new here and hope someone might be able to help.
We have a design in which we'd like to pass the processors control (R/W) and status (R.O.) resisters around using two records: ControlRegisters and StatusRegisters.
Further assume ControlRegisters.TriggerControl(2) controls a trigger pulse that is used in several modules of the design and that the record ControlRegisters is brought into several components at the top level of the design. What we'd like to do is create an alias, call it MasterTrigger_A in a common place so that
1. Every module knows about this particular bit within ControlRegisters.TriggerControl
2. There is a single point of documentation and maintanance of that bit's definition
Initially, we created a package that defines ControlRegisters_type and StatusRegisters_type and the alias MasterTrigger_A defined as follows:
Note the signal declaration is necessary for VHDL to understand what "ControlRegisters" means but as it turns out that's a double edged sword. (More on this in a moment.)
Next in the various .vhd modules we referenced our MasterBlaster_pkg in work. All compiled fine. Except it did not work.
After some experimenting, we took the alias out of MasterBlaster_pkg and placed it in each module that referenced it and everything works fine. So... We believe the problem is that the alias in the package is referencing the signal in the package (same name) and not the signal within the module we were referencing it.
Is there a way to "fix" our approach?
Taking a step back, this CAN'T be all that unique of a requirement. What have you all done?
Thanks to all who take their time to consider this.
Tom
I'm not a new designer but am new here and hope someone might be able to help.
We have a design in which we'd like to pass the processors control (R/W) and status (R.O.) resisters around using two records: ControlRegisters and StatusRegisters.
Further assume ControlRegisters.TriggerControl(2) controls a trigger pulse that is used in several modules of the design and that the record ControlRegisters is brought into several components at the top level of the design. What we'd like to do is create an alias, call it MasterTrigger_A in a common place so that
1. Every module knows about this particular bit within ControlRegisters.TriggerControl
2. There is a single point of documentation and maintanance of that bit's definition
Initially, we created a package that defines ControlRegisters_type and StatusRegisters_type and the alias MasterTrigger_A defined as follows:
Code VHDL - [expand] 1 2 3 4 5 6 7 type Control_Registers_type is record TriggerControl: std_logic_vector(15 downto 0); GpControl: std_logic_vector(15 downto 0); end record; Signal ControlRegisters : ControlRegisters_type; MasterTrigger_A : std_logic is ControlRegisters.TriggerControl(2);
Note the signal declaration is necessary for VHDL to understand what "ControlRegisters" means but as it turns out that's a double edged sword. (More on this in a moment.)
Next in the various .vhd modules we referenced our MasterBlaster_pkg in work. All compiled fine. Except it did not work.
After some experimenting, we took the alias out of MasterBlaster_pkg and placed it in each module that referenced it and everything works fine. So... We believe the problem is that the alias in the package is referencing the signal in the package (same name) and not the signal within the module we were referencing it.
Is there a way to "fix" our approach?
Taking a step back, this CAN'T be all that unique of a requirement. What have you all done?
Thanks to all who take their time to consider this.
Tom