Re: Simulating Inverted Registers



On Jun 30, 1:48 pm, Shannon <sgo...@xxxxxxxxxxxxx> wrote:
Seems like I'm posting a lot lately.  I really appreciate all the help
you guys have given.  You are helping bring me up to speed quickly.
On to the question....

Although my question is about simulation, this concerns a design for
synthesis.

I have a 32-bit register that I load a default value into during
reset.  As Altera has explained to me, the hardware can only pre-load
zeros.  To get a '1' bit they put inverters on each side of the flip-
flop and force it clear.  Ok I get that.

In actuality the "inverters" don't really exist.  They get pushed into
the surrounding logic.  So when I simulate using Quartus's simulator
or ModelSim I probe my register and I get some inverted bits.
(corresponding to where the ones are in my default value).

I've tested the real hardware and it works fine.  I know I'm not the
first person to load a default value into a register.  Is there a
"standard" way of dealing with this in simulation?  I have lots of
ideas but they all seem kludge-y.  I suspect there is some common ways
of dealing with it.

I hope I've explained the situation clear enough.

Thanks,
Shannon

Here is a complete entity that simulates what I'm talking about:

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;

entity inverted is
port
(
reset : in std_logic;
clk : in std_logic;
byte_out : out std_logic_vector(7 downto 0)
);
end inverted;

architecture rtl of inverted is

signal byte : unsigned(7 downto 0);

begin

process(clk, reset)
begin
if reset = '1' then
byte <= X"42"; --arbitrary number for example
elsif rising_edge(clk) then
byte <= byte + 1;
end if;
end process;

byte_out <= std_logic_vector(byte);

end rtl;

In this example byte_out will simulate exactly as you would expect -
starting off at 42h and counting up each clock. "byte" however will
not simulate as you would expect. Well at least not how "I" would
expect. lol

Shannon
.



Relevant Pages

  • Simulating Inverted Registers
    ... I have a 32-bit register that I load a default value into during ... In actuality the "inverters" don't really exist. ... "standard" way of dealing with this in simulation? ...
    (comp.lang.vhdl)
  • Re: Register with a default Value
    ... Do you have any code snippets? ... I just created a register with async reset, and set the default value on ... -- config_reset should initialize to 1s in simulation and synthesis ... I use this in conjunction with a register-controlled soft reset since the hardware's reset net is set up to clear the FPGA. ...
    (comp.lang.vhdl)
  • Re: Register with a default Value
    ... I just created a register with async reset, and set the default value on ... I also tested the solution on the target board and got the same ... ISE that works in both simulation and synthesis (xst targeting ... I'm trying to get a default value for a register that should be different from ...
    (comp.lang.vhdl)
  • Re: Shift Register Set and Feedback
    ... my registers output signal is reg. ... But this is only for simulation purpose. ... this reset at the beginning of your simulation. ... Maybe you should also think about a sychron way to set the register ...
    (comp.lang.vhdl)
  • Re: Substituting a 74HCT74 for a 4013
    ... >I tried adding a pull up resistor to both sets and the second reset. ... >Then I ran the first Q output into one of the inverters on a 7404, ... The HC74 needs a logic low asserted on the SET and RESET inputs in ... while the 4013 needs a logic high to do the ...
    (sci.electronics.basics)