Sign in

username:

password:



Not a member?

Search Comp.Arch.FPGA



Search tips

fpga by Keywords

Altera | ASIC | CPLD | Cyclone | DCM | DDR | DSP | Ethernet | ISE | JTAG | Linux | LVDS | Microblaze | ML310 | Modelsim | NIOS | OPB | PCI | Quartus | RocketIO | SDRAM | Spartan | Spartan3 | SRAM | Stratix | Verilog | VHDL | Virtex | Virtex-4 | Virtex-II | Xilinx | XST


Ads

See Also

DSPEmbedded SystemsElectronics

Comp.Arch.FPGA | Verilog, VHDL, sync and async resets

There are 2 messages in this thread.

You are currently looking at messages 0 to 2.

Verilog, VHDL, sync and async resets - johnp - 2011-08-10 18:53:00

We need to code some modules in both VHDL and
Verilog and would like
to use a parameter/generic
to control inferring sync or async resets.  Is there a clean way to
code this that is similar in both
VHDL and Verilog?

For example, we could try to use `define in Verilog, but this won't
port well to VHDL.  I don't see how
wen can use generate statements in Verilog to do this nicely, either.

Any thoughts?

Thanks!

John Providenza



Re: Verilog, VHDL, sync and async resets - KJ - 2011-08-10 22:02:00

On Aug 10, 6:53=A0pm, johnp
<jprovide...@yahoo.com> wrote:
> We need to code some modules in both VHDL and Verilog and would like
> to use a parameter/generic
> to control inferring sync or async resets. =A0Is there a clean way to
> code this that is similar in both
> VHDL and Verilog?
>
> For example, we could try to use `define in Verilog, but this won't
> port well to VHDL. =A0I don't see how
> wen can use generate statements in Verilog to do this nicely, either.
>
> Any thoughts?
>
> Thanks!
>
> John Providenza

In VHDL, you could do have an entity generic control whether the async
reset logic gets called or not as shown below.  The 'Do reset stuff'
can be implemeted as a procedure that gets invoked in the two places.
That way there is no need to copy/paste the reset actions into the two
places in the code.

process(Clock, Reset)
begin
  if rising_edge(Clock) then
    if (Reset =3D '1') and not(DO_ASYNC_RESET) then
      -- Do reset stuff here
    else
      ...
    end if;
  end if;
  if (Reset =3D '1') and DO_ASYNC_RESET then
    -- Do reset stuff here
  end if;
end process;

Kevin Jennings
______________________________
Join the blogging team on FPGARelated.com and earn rewards! Details Here.