K
KJ
If an entity
- Has an inout port that specifies a default value
- When instantiated, the inout port is left open
- Inside the architecture for that entity that inout signal gets used
for something that affects some other entity output.
Per the LRM, what would be the correct result? Posted below is sample
code where the inout signal is 'Some_Sig1' in the entity 'Foo' which
is given a default value of '1'. Inside the architecture, 'Some_Sig1'
is used to generate another output as
Some_Out2 <= Some_Inp1 and Some_Sig1;
where Some_Inp is an input. My interpretation is that since
'Some_Sig1' has no drivers inside the architecture, the specified
default value of '1' would apply and therefore the above statement
would reduce to
Some_Out2 <= Some_Inp1;
Simulation with Modelsim 6.4 seems to agree with that interpretation,
two synthesis tools give two completely different results.
From the VHDL FAQ archives is
http://www.vhdl.org/comp.lang.vhdl/FAQ4.html#default expression
"B.58 default expression: A default value that is used for a formal
generic, port, or parameter if the interface object is unassociated. A
default expression is also used to provide an initial value for
signals and their drivers. (§4.3.1.2, §4.3.2.2)"
From Ashenden's "The Designer's Guide to VHDL" Chapter 5, page 148
http://books.google.com/books?id=77...&hl=en&sa=X&oi=book_result&resnum=6&ct=result
"If a port of mode inout is left open, the value used internally by
the entity (the effective value) is the value that it drives on to the
port"
Both of these seem to support my interpretation that the signal
'Some_Sig1', from the perspective of the entity (entity Foo in my code
below) should, when used, have a value of '1' if one interprets a
default value on an inout to be a potential "driver on to the port".
Is there something else in the LRM that I'm missing that would counter
that interpretation? I'm working with one of the synthesis vendors to
get the correct interpretation where they are currently incorrectly
erroring out.
KJ
---- Start of sample code
library ieee;
use ieee.std_logic_1164.all;
entity Foo is
port(
Some_Sig1: inout std_ulogic := '1';
Some_Inp1: in std_ulogic;
Some_Inp2: in std_ulogic;
Some_Out2: out std_ulogic);
end Foo;
architecture RTL of Foo is
begin
-- Some_Sig1 <= '0';
Some_Out2 <= Some_Inp1 and Some_Sig1;
end RTL;
library ieee;
use ieee.std_logic_1164.all;
entity Foo_Top is
port(
Some_Inp1: in std_ulogic;
Some_Inp2: in std_ulogic;
Some_Out2: out std_ulogic);
end Foo_Top;
architecture RTL of Foo_Top is
begin
The_Foo : entity work.Foo
port map(
Some_Sig1 => open,
Some_Inp1 => Some_Inp1,
Some_Inp2 => Some_Inp2,
Some_Out2 => Some_Out2);
end RTL;
---- End of sample code
- Has an inout port that specifies a default value
- When instantiated, the inout port is left open
- Inside the architecture for that entity that inout signal gets used
for something that affects some other entity output.
Per the LRM, what would be the correct result? Posted below is sample
code where the inout signal is 'Some_Sig1' in the entity 'Foo' which
is given a default value of '1'. Inside the architecture, 'Some_Sig1'
is used to generate another output as
Some_Out2 <= Some_Inp1 and Some_Sig1;
where Some_Inp is an input. My interpretation is that since
'Some_Sig1' has no drivers inside the architecture, the specified
default value of '1' would apply and therefore the above statement
would reduce to
Some_Out2 <= Some_Inp1;
Simulation with Modelsim 6.4 seems to agree with that interpretation,
two synthesis tools give two completely different results.
From the VHDL FAQ archives is
http://www.vhdl.org/comp.lang.vhdl/FAQ4.html#default expression
"B.58 default expression: A default value that is used for a formal
generic, port, or parameter if the interface object is unassociated. A
default expression is also used to provide an initial value for
signals and their drivers. (§4.3.1.2, §4.3.2.2)"
From Ashenden's "The Designer's Guide to VHDL" Chapter 5, page 148
http://books.google.com/books?id=77...&hl=en&sa=X&oi=book_result&resnum=6&ct=result
"If a port of mode inout is left open, the value used internally by
the entity (the effective value) is the value that it drives on to the
port"
Both of these seem to support my interpretation that the signal
'Some_Sig1', from the perspective of the entity (entity Foo in my code
below) should, when used, have a value of '1' if one interprets a
default value on an inout to be a potential "driver on to the port".
Is there something else in the LRM that I'm missing that would counter
that interpretation? I'm working with one of the synthesis vendors to
get the correct interpretation where they are currently incorrectly
erroring out.
KJ
---- Start of sample code
library ieee;
use ieee.std_logic_1164.all;
entity Foo is
port(
Some_Sig1: inout std_ulogic := '1';
Some_Inp1: in std_ulogic;
Some_Inp2: in std_ulogic;
Some_Out2: out std_ulogic);
end Foo;
architecture RTL of Foo is
begin
-- Some_Sig1 <= '0';
Some_Out2 <= Some_Inp1 and Some_Sig1;
end RTL;
library ieee;
use ieee.std_logic_1164.all;
entity Foo_Top is
port(
Some_Inp1: in std_ulogic;
Some_Inp2: in std_ulogic;
Some_Out2: out std_ulogic);
end Foo_Top;
architecture RTL of Foo_Top is
begin
The_Foo : entity work.Foo
port map(
Some_Sig1 => open,
Some_Inp1 => Some_Inp1,
Some_Inp2 => Some_Inp2,
Some_Out2 => Some_Out2);
end RTL;
---- End of sample code