FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-19-2009, 05:50 PM
lenz19@gmx.de
Guest
 
Posts: n/a
Default FDRSE Spartan 3A - Active high/low set/reset

Hi,

I have to instantiate (not inference) two FDRSE elements in my VHDL-
Code.

FDRSE1 should have active-high set/reset.
FDRSE2 should have active-low set/reset.

This is the instantiation code from the Libraries Guide:

FDRSE_inst : FDRSE
generic map (INIT => '0') -- Initial value of register ('0' or '1')
port map (
Q => Q, -- Data output
C => C, -- Clock input
CE => CE, -- Clock enable input
D => D, -- Data input
R => R, -- Synchronous reset input
S => S -- Synchronous set input
);

In this instantiation code, there is no possibility to configure the
set/reset polarity.

My two questions are:

1. How to instantiate a FDRSE with active-high set/reset
2. How to instantiate a FDRSE with active-low set/reset

Thanks in advance,
Mark Lenz

Reply With Quote
  #2 (permalink)  
Old 06-19-2009, 06:49 PM
Rob Gaddi
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

On Fri, 19 Jun 2009 09:50:27 -0700 (PDT)
lenz19@gmx.de wrote:

> Hi,
>
> I have to instantiate (not inference) two FDRSE elements in my VHDL-
> Code.
>
> FDRSE1 should have active-high set/reset.
> FDRSE2 should have active-low set/reset.
>
> This is the instantiation code from the Libraries Guide:
>
> FDRSE_inst : FDRSE
> generic map (INIT => '0') -- Initial value of register ('0' or '1')
> port map (
> Q => Q, -- Data output
> C => C, -- Clock input
> CE => CE, -- Clock enable input
> D => D, -- Data input
> R => R, -- Synchronous reset input
> S => S -- Synchronous set input
> );
>
> In this instantiation code, there is no possibility to configure the
> set/reset polarity.
>
> My two questions are:
>
> 1. How to instantiate a FDRSE with active-high set/reset
> 2. How to instantiate a FDRSE with active-low set/reset
>
> Thanks in advance,
> Mark Lenz
>


1. You just did.
2. R => not R, S => not S

Out of curiosity, why would you need to be directly instantiating
flops? I've found very few situations where that's actually the right
answer (ripple counters, etc).

--
Rob Gaddi, Highland Technology
Email address is currently out of order
Reply With Quote
  #3 (permalink)  
Old 06-19-2009, 08:19 PM
john
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

On Jun 19, 10:49*am, Rob Gaddi <rga...@technologyhighland.com> wrote:
> On Fri, 19 Jun 2009 09:50:27 -0700 (PDT)
>
>
>
> len...@gmx.de wrote:
> > Hi,

>
> > I have to instantiate (not inference) two FDRSE elements in my VHDL-
> > Code.

>
> > FDRSE1 should have active-high set/reset.
> > FDRSE2 should have active-low *set/reset.

>
> > This is the instantiation code from the Libraries Guide:

>
> > FDRSE_inst : FDRSE
> > generic map (INIT => '0') -- Initial value of register ('0' or '1')
> > port map (
> > * * * * * * * * * Q * *=> Q, * * *-- Dataoutput
> > * * * * * * * * * C * *=> C, * * *-- Clock input
> > * * * * * * * * * CE => CE, * *-- Clock enable input
> > * * * * * * * * * D * => D, * * *-- Data input
> > * * * * * * * * * R * => R, * * *-- Synchronous reset input
> > * * * * * * * * * S * => S * * * -- Synchronous set input
> > );

>
> > In this instantiation code, there is no possibility to configure the
> > set/reset polarity.

>
> > My two questions are:

>
> > 1. How to instantiate a FDRSE with active-high set/reset
> > 2. How to instantiate a FDRSE with active-low *set/reset

>
> > Thanks in advance,
> > Mark Lenz

>
> 1. You just did.
> 2. R => not R, S => not S
>
> Out of curiosity, why would you need to be directly instantiating
> flops? *I've found very few situations where that's actually the right
> answer (ripple counters, etc).
>
> --
> Rob Gaddi, Highland Technology
> Email address is currently out of order


I believe XST will not directly infer DDR output flops. At least it
didn't used to be
able to do this. I've always had to instantiate DDR output flops.

John Providenza
Reply With Quote
  #4 (permalink)  
Old 06-20-2009, 12:59 AM
lenz19@gmx.de
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

Rob, John thanks for reply.


>> 2. R => not R, S => not S



That's the point.
Your suggestion would infer an inverter realized in a LUT.
I don't want to infer extra inverter logic in the CLB. I want the
inverter for free.

In the Storage Elements Section of the User Guide for Spartan it is
statet that
"All signals have programmable polarity; the default active-High
function is described."

So, I am looking for a way to configure the polarity of the set/reset
signals of a FDRSE.


>> Out of curiosity, why would you need to be directly instantiating flops?



I want to use the three inputs (set, reset and data) of the FDRSE at
the same time
without infering extra LUT-Logic.

Something like this:

Connect signal a to set-input, signal b to reset-input and signal c to
data-input.


Thanks for your contribution.


Reply With Quote
  #5 (permalink)  
Old 06-20-2009, 01:19 AM
Rob Gaddi
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

On Fri, 19 Jun 2009 16:59:13 -0700 (PDT)
lenz19@gmx.de wrote:

> Rob, John thanks for reply.
>
>
> >> 2. R => not R, S => not S

>
>
> That's the point.
> Your suggestion would infer an inverter realized in a LUT.
> I don't want to infer extra inverter logic in the CLB. I want the
> inverter for free.
>


That's why there's a synthesis tool that's able to perform
optimization. Last I checked, if you go back in to the FPGA Editor
and look in on what you've got, you'll find that XST will very
happily have collapsed those inverters into the free ones built into
the slice.

You seem to be of the opinion that it's necessary for you to outsmart
the synthesis tools. As I said earlier, it's really rarely the case.
If you code:

process(clk, r, s)
begin
if (r = '1') then
q <= '0';
elsif (s = '1') then
q <= '1';
elseif rising_edge(clk) then
q <= d;
end if;
end process;

You'll find that the synthesis tool still gives you exactly what you
wanted, without you having to slog through unnecessary direct
instatiation. The people telling you that it doesn't work haven't updated their opinions since the mid 1990s.

--
Rob Gaddi, Highland Technology
Email address is currently out of order
Reply With Quote
  #6 (permalink)  
Old 06-20-2009, 01:35 AM
lenz19@gmx.de
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

On 20 Jun., 02:19, Rob Gaddi <rga...@technologyhighland.com> wrote:
> On Fri, 19 Jun 2009 16:59:13 -0700 (PDT)
>
> len...@gmx.de wrote:
> > Rob, John thanks for reply.

>
> > >> 2. R => not R, S => not S

>
> > That's the point.
> > Your suggestion would infer an inverter realized in a LUT.
> > I don't want to infer extra inverter logic in the CLB. I want the
> > inverter for free.

>
> That's why there's a synthesis tool that's able to perform
> optimization. *Last I checked, if you go back in to the FPGA Editor
> and look in on what you've got, you'll find that XST will very
> happily have collapsed those inverters into the free ones built into
> the slice.
>
> You seem to be of the opinion that it's necessary for you to outsmart
> the synthesis tools. *As I said earlier, it's really rarely the case.
> If you code:
>
> process(clk, r, s)
> begin
> * if (r = '1') then
> * * q <= '0';
> * elsif (s = '1') then
> * * q <= '1';
> * elseif rising_edge(clk) then
> * * q <= d;
> * end if;
> end process;
>
> You'll find that the synthesis tool still gives you exactly what you
> wanted, without you having to slog through unnecessary direct
> instatiation. *The people telling you that it doesn't work haven't updated their opinions since the mid 1990s.
>
> --
> Rob Gaddi, Highland Technology
> Email address is currently out of order


I will try this and give you a feedback whether it worked or not.

Thank you for sharing your knowledge.
Reply With Quote
  #7 (permalink)  
Old 06-20-2009, 05:12 AM
Andreas Ehliar
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

On 2009-06-19, john <jprovidenza@yahoo.com> wrote:
> I believe XST will not directly infer DDR output flops. At least it
> didn't used to be
> able to do this. I've always had to instantiate DDR output flops.


Another reason to manually instantiate a flip-flop is when the synthesis tool
is doing something suboptimal. For example, I've noticed that XST relatively
often places my critical path on the SR input of flip-flops even though that
path is quite a bit slower than the D input. In those cases I usually
instantiate the flip-flop manually to control what is going on.

(It is possible that a synthesis keep option would also help here though instead
of manually instantiating the flip-flop.)

/Andreas
Reply With Quote
  #8 (permalink)  
Old 06-20-2009, 06:51 AM
Ed McGettigan
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

Rob Gaddi wrote:
> On Fri, 19 Jun 2009 16:59:13 -0700 (PDT)
> lenz19@gmx.de wrote:
>
>> Rob, John thanks for reply.
>>
>>
>>>> 2. R => not R, S => not S

>>
>> That's the point.
>> Your suggestion would infer an inverter realized in a LUT.
>> I don't want to infer extra inverter logic in the CLB. I want the
>> inverter for free.
>>

>
> That's why there's a synthesis tool that's able to perform
> optimization. Last I checked, if you go back in to the FPGA Editor
> and look in on what you've got, you'll find that XST will very
> happily have collapsed those inverters into the free ones built into
> the slice.
>
> You seem to be of the opinion that it's necessary for you to outsmart
> the synthesis tools. As I said earlier, it's really rarely the case.
> If you code:
>
> process(clk, r, s)
> begin
> if (r = '1') then
> q <= '0';
> elsif (s = '1') then
> q <= '1';
> elseif rising_edge(clk) then
> q <= d;
> end if;
> end process;
>
> You'll find that the synthesis tool still gives you exactly what you
> wanted, without you having to slog through unnecessary direct
> instatiation. The people telling you that it doesn't work haven't updated their opinions since the mid 1990s.
>


The code above is not equivalent to FDRSE, but this code is:

process (clk)
begin
if rising_edge(clk) then
if (r = '1') then
q <= '0';
elsif (s = '1') then
q <= '1';
elsif (ce = '1') then
q <= d;
end if;
end process;

Ed McGettigan
--
Xilinx Inc.

Reply With Quote
  #9 (permalink)  
Old 06-21-2009, 03:05 PM
lenz19@gmx.de
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

On Jun 20, 7:51*am, Ed McGettigan <ed.mcgetti...@xilinx.com> wrote:
> Rob Gaddi wrote:
> > On Fri, 19 Jun 2009 16:59:13 -0700 (PDT)
> > len...@gmx.de wrote:

>
> >> Rob, John thanks for reply.

>
> >>>> 2. R => not R, S => not S

>
> >> That's the point.
> >> Your suggestion would infer an inverter realized in a LUT.
> >> I don't want to infer extra inverter logic in the CLB. I want the
> >> inverter for free.

>
> > That's why there's a synthesis tool that's able to perform
> > optimization. *Last I checked, if you go back in to the FPGA Editor
> > and look in on what you've got, you'll find that XST will very
> > happily have collapsed those inverters into the free ones built into
> > the slice.

>
> > You seem to be of the opinion that it's necessary for you to outsmart
> > the synthesis tools. *As I said earlier, it's really rarely the case.
> > If you code:

>
> > process(clk, r, s)
> > begin
> > * if (r = '1') then
> > * * q <= '0';
> > * elsif (s = '1') then
> > * * q <= '1';
> > * elseif rising_edge(clk) then
> > * * q <= d;
> > * end if;
> > end process;

>
> > You'll find that the synthesis tool still gives you exactly what you
> > wanted, without you having to slog through unnecessary direct
> > instatiation. *The people telling you that it doesn't work haven't updated their opinions since the mid 1990s.

>
> The code above is not equivalent to FDRSE, but this code is:
>
> process (clk)
> begin
> * * if rising_edge(clk) then
> * * * if (r = '1') then
> * * * * *q <= '0';
> * * * elsif (s = '1') then
> * * * * *q <= '1';
> * * * elsif (ce = '1') then
> * * * * *q <= d;
> * * * end if;
> end process;
>
> Ed McGettigan
> --
> Xilinx Inc.- Hide quoted text -
>
> - Show quoted text -


That code worked. It describes a FDRSE with high-active set/reset.

If you change your code to this:

process (clk)
begin
if rising_edge(clk) then
if (r = '0') then
q <= '0';
elsif (s = '0') then
q <= '1';
elsif (ce = '1') then
q <= d;
end if;
end process;

it becomes a FDRSE with low-active set/reset without LUT-Logic for the
inverter.




Reply With Quote
  #10 (permalink)  
Old 06-22-2009, 04:46 PM
Rob Gaddi
Guest
 
Posts: n/a
Default Re: FDRSE Spartan 3A - Active high/low set/reset

On Fri, 19 Jun 2009 22:51:40 -0700
Ed McGettigan <ed.mcgettigan@xilinx.com> wrote:

> Rob Gaddi wrote:
> > On Fri, 19 Jun 2009 16:59:13 -0700 (PDT)
> > lenz19@gmx.de wrote:
> >
> >> Rob, John thanks for reply.
> >>
> >>
> >>>> 2. R => not R, S => not S
> >>
> >> That's the point.
> >> Your suggestion would infer an inverter realized in a LUT.
> >> I don't want to infer extra inverter logic in the CLB. I want the
> >> inverter for free.
> >>

> >
> > That's why there's a synthesis tool that's able to perform
> > optimization. Last I checked, if you go back in to the FPGA Editor
> > and look in on what you've got, you'll find that XST will very
> > happily have collapsed those inverters into the free ones built into
> > the slice.
> >
> > You seem to be of the opinion that it's necessary for you to
> > outsmart the synthesis tools. As I said earlier, it's really
> > rarely the case. If you code:
> >
> > process(clk, r, s)
> > begin
> > if (r = '1') then
> > q <= '0';
> > elsif (s = '1') then
> > q <= '1';
> > elseif rising_edge(clk) then
> > q <= d;
> > end if;
> > end process;
> >
> > You'll find that the synthesis tool still gives you exactly what you
> > wanted, without you having to slog through unnecessary direct
> > instatiation. The people telling you that it doesn't work haven't
> > updated their opinions since the mid 1990s.
> >

>
> The code above is not equivalent to FDRSE, but this code is:
>
> process (clk)
> begin
> if rising_edge(clk) then
> if (r = '1') then
> q <= '0';
> elsif (s = '1') then
> q <= '1';
> elsif (ce = '1') then
> q <= d;
> end if;
> end process;
>
> Ed McGettigan
> --
> Xilinx Inc.
>


Good catch, you're exactly right. I coded FDCPE instead. Teach me to
post past five on a Friday, jacket in hand.

--
Rob Gaddi, Highland Technology
Email address is currently out of order
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing to reset vectors - xilinx spartan 3an hvo FPGA 2 05-28-2009 04:51 PM
Spartan 3E reset problem Digi Suji FPGA 3 01-18-2009 10:38 AM
VCCAUX too high on a Spartan 3 design Dan K FPGA 10 09-17-2007 05:28 PM
high voltage input on SPARTAN-3 FPGAs: MTBF reduction? AugustoEinsfeldt FPGA 15 07-04-2007 01:03 AM
Active HIGH / Active LOW muthusnv@rediffmail.com FPGA 4 01-31-2005 11:18 PM


All times are GMT +1. The time now is 03:42 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved