|
LCS-2016-070 History |
|
3 |
|
26-Mar-2017 |
|
Voting |
|
Patrick Lehmann Martin Zabel |
|
Main.PatrickLehmann Main.MartinZabel |
|
Bidirectional Connections |
|
Adds bidirectional connections aka. Spaceship assignments. |
library ieee; use ieee.std_logic_1164.all; entity top is port ( clk : in std_ulogic; dbus : inout std_logic); end entity top; architecture a of top is component sub is port ( clk : in std_ulogic; rx : in std_ulogic; tx : out std_ulogic; dbus : inout std_logic); end component sub; signal sub1_clk : std_ulogic; signal sub1_rx : std_ulogic; signal sub1_tx : std_ulogic; signal sub1_dbus : std_logic; signal sub2_clk : std_ulogic; signal sub2_rx : std_ulogic; signal sub2_tx : std_ulogic; signal sub2_dbus : std_logic; begin sub1: sub port map ( clk => sub1_clk, rx => sub1_rx, tx => sub1_rx, dbus => sub1_dbus); sub2: sub port map ( clk => sub2_clk, rx => sub2_rx, tx => sub2_tx, dbus => sub2_dbus); sub1_clk <=> clk; -- clock distribution sub2_clk <=> clk; sub1_rx <=> sub2_tx; -- cross-over link sub2_rx <=> sub1_tx; sub1_dbus <=> dbus; -- shared data-bus sub2_dbus <=> dbus; d1: dbus <= 'H'; -- driver 'd1' generated by this statement end architecture a;Step 1: Primary Sources For a signal of a scalar type, each primary source is either a driver (see 14.7.2) or an out, inout, buffer, or linkage port of a component instance or of a block statement with which the signal is associated.
primary_sources(clk) = {} primary_sources(dbus) = { d1 } primary_sources(sub1_clk) = {} primary_sources(sub1_rx) = {} primary_sources(sub1_tx) = { sub1.tx } -- sub1.tx is the tx port of component instance sub1 primary_sources(sub1_dbus) = { sub1.dbus } -- sub1.dbus is the tx port of component instance sub1 primary_sources(sub2_clk) = {} primary_sources(sub2_rx) = {} primary_sources(sub2_tx) = { sub2.tx } -- sub2.tx is the tx port of component instance sub2 primary_sources(sub2_dbus) = { sub2.dbus } -- sub2.dbus is the tx port of component instance sub2Step 2: Secondary sources For a signal of a scalar type, the subset of secondary sources is the union of all primary sources of all other signals in the same association group.
secondary_sources(clk) = primary_sources(sub1_clk) u primary_sources(sub2_clk) = {} secondary_sources(dbus) = primary_sources(sub1_dbus) u primary_sources(sub2_dbus) = { sub1.dbus, sub2.dbus } secondary_sources(sub1_clk) = primary_sources(clk) u primary_sources(sub2_clk) = {} secondary_sources(sub1_rx) = primary_sources(sub2_tx) = { sub2.tx } secondary_sources(sub1_tx) = primary_sources(sub2_rx) = {} secondary_sources(sub1_dbus) = primary_sources(dbus) u primary_sources(sub2_dbus) = { d1, sub2.dbus } secondary_sources(sub2_clk) = primary_sources(clk) u primary_sources(sub1_clk) = {} secondary_sources(sub2_rx) = primary_sources(sub1_tx) = { sub1.tx } secondary_sources(sub2_tx) = primary_sources(sub1_rx) = {} secondary_sources(sub2_dbus) = primary_sources(dbus) u primary_sources(sub1_dbus) = { d1, sub1.dbus }Step 3: Final Set of Sources A signal may have one or more sources. For a signal of a scalar type, the set of sources is the union of the subset of primary sources and of the subset of secondary sources.
sources(clk) = primary_sources(clk) u secondary_sources(clk) = {} sources(dbus) = { d1, sub1.dbus, sub2.dbus } sources(sub1_clk) = {} sources(sub1_rx) = { sub2.tx } sources(sub1_tx) = { sub1.tx } sources(sub1_dbus) = { d1, sub1.dbus, sub2.dbus } sources(sub2_clk) = {} sources(sub2_rx) = { sub1.tx } sources(sub2_tx) = { sub2.tx } sources(sub2_dbus) = { d1, sub1.dbus, sub2.dbus }Driving Values The computation of the driving values according to clause 14.7.3.2 can now be done in the following order. Note, ports of mode in do not have a source, the value of the actual is passed using the effective value. The outputs of the sub-component will have sources inside the sub-components as well, these are denoted as "...". If the source is a driver, than the driving value of this source is the current value of the driver. The driving values of all signals within a list item can be computed in parallel:
1. clk, sub1_clk, sub2_clk, d1, ... 2. sub1.tx, sub1.dbus, sub2.tx, sub2.dbus 3. dbus, sub1_rx, sub1_tx, sub1_dbus, sub2_rx, sub2_tx, sub2_dbusThe new values of
sub1_dbus
and sub2_dbus
are passed into the sub-components
using the effective values as described in clause 14.7.3.3.
concurrent_statement ::=
block_statement
| process_statement
| concurrent_procedure_call_statement
| concurrent_assertion_statement
| concurrent_signal_assignment_statement
| concurrent_signal_association_statement
| component_instantiation_statement
| generate_statement
| PSL_PSL_Directive
concurrent_signal_association_statement ::=
[ label : ] concurrent_simple_signal_association
concurrent_simple_signal_association ::=
lhs_signal_association_target <=> rhs_signal_association_target ;
signal_association_target ::=
signal_name
A signal association implies no direction of information exchange between signal association targets (henceforth referred to as targets). & ' ( ) * + , - . / : ; < = > ` | [ ] ? @or one of the following compound delimiters, each composed of two or more adjacent special characters:
=> ** := /= >= <= <> <=> ?? ?= ?/= ?< ?<= ?> ?>= << >>
[...]
NOTE 2 -- The following names are used when referring to compound delimiters:
Delimiter | Name |
---|---|
=> | Arrow |
** | Double star, exponentiate |
:= | Variable assignment |
/= | Inequality (pronounced "not equal") |
>= | Greater than or equal |
<= | Less than or equal; signal assignment |
<> | Box |
<=> | Signal association |
?? | Condition conversion |
?= | Matching equality |
?/= | Matching inequality |
?< | Matching less than |
?<= | Matching less than or equal |
?> | Matching greater than |
?>= | Matching greater than or equal |
<< | Double less than |
>> | Double greater than |
[...] concurrent_assertion_statement ::= [ label : ] [ postponed ] assertion ; concurrent_signal_association_statement ::= [ label : ] concurrent_simple_signal_association concurrent_conditional_signal_assignment ::= target <= [ guarded ] [ delay_mechanism ] conditional_waveforms ; concurrent_procedure_call_statement ::= [ label : ] [ postponed ] procedure_call ; concurrent_selected_signal_assignment ::= with expression select [ ? ] target <= [ guarded ] [ delay_mechanism ] selected_waveforms ; concurrent_signal_assignment_statement ::= [ label : ] [ postponed ] concurrent_simple_signal_assignment | [ label : ] [ postponed ] concurrent_conditional_signal_assignment | [ label : ] [ postponed ] concurrent_selected_signal_assignment concurrent_simple_signal_association ::= lhs_signal_association_target <=> rhs_signal_association_target ; concurrent_simple_signal_assignment ::= target <= [ guarded ] [ delay_mechanism ] waveform ; concurrent_statement ::= block_statement | process_statement | concurrent_procedure_call_statement | concurrent_assertion_statement | concurrent_signal_assignment_statement | concurrent_signal_association_statement | component_instantiation_statement | generate_statement | PSL_PSL_Directive [...] signal_association_target ::= signal_name
<=>
work for aggregates too?
TBP: This operator is a handy alternative for an alias and allows to manipulate aliasing in
the implementation rather than the declarative part. Especially composite associations with
elements of different directions are valuable. Aggregates would really be another plus that
would allow to easily alias individual local signals into composites.
Minor fixes: asso(z -> c)iate, capitalization in table of delimiters
-- Thomas Preusser - 2017-01-17
Minor fix, the following line's all tangled up:
"This allows all sources, gathered of each individual signal in the association group, can be resolved by the same resolution functions, if any."
Did you mean: "This allows all sources gathered from each individual signal in the association to be resolved by the same resolution function, if any."?
Other than that this all looks good. For all the work you've done here, I'm actually astonished how little additional language it takes to add the spaceship operator into VHDL.
-- Rob Gaddi - 2017-01-19
Also, before the sentence pointed out by Rob, there's a tiny typo: "either declared in a subtype declaration, or in a signal object declaration."
Do we allow conditional and selected signal assignments as given by Jim?
e.g.
BusA <=> BusB when Enable; with BusSelect select BusA <=> BusB when "00", BusC when "01", BusD when "10", NULL when others; concurrent_bidirectional_signal_association_statement ::= [ label : ] concurrent_simple_bidirectional_signal_association | [ label : ] concurrent_conditional_bidirectional_signal_association | [ label : ] concurrent_selected_bidirectional_signal_association [Comment Notes: Just added delay_mechanism here to be consistent with ordinary concurrent signal assignments.] concurrent_simple_bidirectional_signal_association ::= lhs_signal_association_target <=> rhs_signal_association_target [ [delay_mechanism] <=> rhs_signal_association_target ] ; [Comment Notes: Add these wordings] concurrent_conditional_bidirectional_signal_association ::= lhs_signal_association_target <=> [delay_mechanism] rhs_signal_association_target [ [delay_mechanism] <=> rhs_signal_association_target ] conditional_waveforms ; concurrent_selected_bidirectional_signal_association ::= with expression select [ ? ] lhs_signal_association_target <= [ delay_mechanism ] rhs_signal_association_target [ [delay_mechanism] <=> rhs_signal_association_target ] selected_waveforms ;-- Daniel Kho - 2017-01-19 This LCS is still a draft and not finalized. I don't see conditional associations working in a first revisions. I would wait for a first implementation in tools and see if it works. Then we can start to think about extensions. @all Please keep in mind, we are altering the core of the elaboration process with this LCS. Any tiny mistake could break the complete language! -- Patrick Lehmann - 2017-01-19 Agreed to implement in small changes. I'm voting for this proposal. -- Daniel Kho - 2017-02-03
<=>
is to have no delay in Delta cycles. So your second idea doesn't fit the intend.
It's hard enough to bring this LCS into a correct form without breaking the simulation kernel. Currently, there hasn't been
much review work from other person's except for Martin. No one I asked feels safe enough to talk to me about driving and
effective values or sources. I won't add more features unless people are willing to dig into the simulation cycle part of the LRM.
Why would you need to model a transmission gate without Delta cycles? And why do you need to model such a low-level element at all?
-- Patrick Lehmann - 2017-03-22