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 11-02-2009, 03:20 PM
Sam Kerr
Guest
 
Posts: n/a
Default Need some help creating a ring oscillator on a Spartan-3AN

I'm trying to create a ring oscillator for my FPGA design but I've run
into some problems. Namely, it doesn't seem like any oscillation is
occurring. I've hooked up the output signal to LEDs and the serial port,
but neither of these shows any oscillations.

A few things I think might be happening is that the oscillation is so fast
I just can't see it, the oscillation is too fast for the board, it's
getting optimized out during synthesis, or (probably) my Verilog file is
implemented incorrectly.

Can you help me with this? See below for the Verilog modules I'm using.


module ringoscillator(
input wire stop,
output wire out
);

wire connector;
wire w1, w2, w3, w4;

nandgate inputGate(.i1(stop), .i2(connector), .out(w1));
invertergate inv1(.in(w1), .out(w2));
invertergate inv2(.in(w2), .out(w3));
invertergate inv3(.in(w3), .out(w4));
invertergate inv4(.in(w4), .out(connector));

assign out = connector;

endmodule

module nandgate(
input wire i1, i2,
output wire out);

assign out = ~(i1 & i2);
endmodule

module invertergate(
input wire in,
output wire out);

assign out = ~in;
endmodule


Thanks for any help!
Reply With Quote
  #2 (permalink)  
Old 11-02-2009, 04:01 PM
Antti
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Nov 2, 4:20*pm, Sam Kerr <stk...@purdue.edu> wrote:
> I'm trying to create a ring oscillator for my FPGA design but I've run
> into some problems. Namely, it doesn't seem like any oscillation is
> occurring. I've hooked up the output signal to LEDs and the serial port,
> but neither of these shows any oscillations.
>
> A few things I think might be happening is that the oscillation is so fast
> I just can't see it, the oscillation is too fast for the board, it's
> getting optimized out during synthesis, or (probably) my Verilog file is
> implemented incorrectly.
>
> Can you help me with this? See below for the Verilog modules I'm using.
>
> module ringoscillator(
> input wire stop,
> output wire out
> );
>
> wire connector;
> wire w1, w2, w3, w4;
>
> nandgate inputGate(.i1(stop), .i2(connector), .out(w1));
> invertergate inv1(.in(w1), .out(w2));
> invertergate inv2(.in(w2), .out(w3));
> invertergate inv3(.in(w3), .out(w4));
> invertergate inv4(.in(w4), .out(connector));
>
> assign out = connector;
>
> endmodule
>
> module nandgate(
> input wire i1, i2,
> output wire out);
>
> assign out = ~(i1 & i2);
> endmodule
>
> module invertergate(
> input wire in,
> output wire out);
>
> assign out = ~in;
> endmodule
>
> Thanks for any help!


looks xilinx examples if you dont get it working yourself

there are many ways of doing ring oscillators some work too

se sk freq meter ref design includes ring osc

Antti
Reply With Quote
  #3 (permalink)  
Old 11-02-2009, 04:32 PM
austin
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

Sam,

Most synthesis tools optimize out any unnecessary logic, so the
synthesis tool will look at your code, and remove all but one
inverter.

It will then either not oscillate (not enough delay), or it will
oscillate so fast, you will be unable to see anything on an IO pin.

Read through the synthesis manual, and you will find attributes like
"keep" and "save" which direct the tools to not rip things out (you
really wanted to do something that obvious).

The place and route tools also optimize, so this also may be happening
after synthesis.

Austin
Reply With Quote
  #4 (permalink)  
Old 11-02-2009, 06:19 PM
Gabor
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Nov 2, 9:20*am, Sam Kerr <stk...@purdue.edu> wrote:
> I'm trying to create a ring oscillator for my FPGA design but I've run
> into some problems. Namely, it doesn't seem like any oscillation is
> occurring. I've hooked up the output signal to LEDs and the serial port,
> but neither of these shows any oscillations.
>
> A few things I think might be happening is that the oscillation is so fast
> I just can't see it, the oscillation is too fast for the board, it's
> getting optimized out during synthesis, or (probably) my Verilog file is
> implemented incorrectly.
>
> Can you help me with this? See below for the Verilog modules I'm using.
>
> module ringoscillator(
> input wire stop,
> output wire out
> );
>
> wire connector;
> wire w1, w2, w3, w4;
>
> nandgate inputGate(.i1(stop), .i2(connector), .out(w1));
> invertergate inv1(.in(w1), .out(w2));
> invertergate inv2(.in(w2), .out(w3));
> invertergate inv3(.in(w3), .out(w4));
> invertergate inv4(.in(w4), .out(connector));
>
> assign out = connector;
>
> endmodule
>
> module nandgate(
> input wire i1, i2,
> output wire out);
>
> assign out = ~(i1 & i2);
> endmodule
>
> module invertergate(
> input wire in,
> output wire out);
>
> assign out = ~in;
> endmodule
>
> Thanks for any help!


I'm not sure this works on wires as well as regs, but try:

(* KEEP = "TRUE" *) wire connector; // This wire should be kept
anyway
(* KEEP = "TRUE" *) wire w1, w2, w3, w4; // Some of these would get
ripped out

Older versions of XST would not keep simple gates. The brute force
method
is to take out and dust off the old libraries guide and instantiate a
LUT
with the appropriate INIT functions for your gates. However I think
that
if you're using a relatively recent version of XST the KEEP attribute
should
do the trick.

Regards,
Gabor
Reply With Quote
  #5 (permalink)  
Old 11-02-2009, 09:08 PM
glen herrmannsfeldt
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

Sam Kerr <[email protected]> wrote:

> I'm trying to create a ring oscillator for my FPGA design but I've run
> into some problems. Namely, it doesn't seem like any oscillation is
> occurring. I've hooked up the output signal to LEDs and the serial port,
> but neither of these shows any oscillations.
>
> A few things I think might be happening is that the oscillation is so fast
> I just can't see it, the oscillation is too fast for the board, it's
> getting optimized out during synthesis, or (probably) my Verilog file is
> implemented incorrectly.


If you really mean "see", I am pretty sure it would be too fast
to see on the LED. In the CD4000 series days, we used to make slower
ones with three inverters and an RC delay. (Or maybe with just one.)
If you do keep all three inverters (no optimizing them away), you
should be in the 100's of MHz range. Run through a 30 bit ripple
counter and then you should be able to see it.

-- glen
Reply With Quote
  #6 (permalink)  
Old 11-03-2009, 08:41 AM
-jg
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Nov 3, 3:20*am, Sam Kerr <stk...@purdue.edu> wrote:
> I'm trying to create a ring oscillator for my FPGA design but I've run
> into some problems. Namely, it doesn't seem like any oscillation is
> occurring. I've hooked up the output signal to LEDs and the serial port,
> but neither of these shows any oscillations.


It is 'good practice' when doing ring oscillators, to build them
using
alternate inverter/nand/inverter/nand + final inverter/nand and enable
the nands from your reset.

This ensures it does start correctly, and also helps avoid the
optimize away diseases...

Start with a LOT of elements in your ring, and calculate a delay for
a pair, then revisit your element count.
Not many data sheets have these numbers... I guess they are scared
designers might rely on the numbers.

-jg

Reply With Quote
  #7 (permalink)  
Old 11-03-2009, 08:57 AM
Antti
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Nov 3, 9:41*am, -jg <jim.granvi...@gmail.com> wrote:
> On Nov 3, 3:20*am, Sam Kerr <stk...@purdue.edu> wrote:
>
> > I'm trying to create a ring oscillator for my FPGA design but I've run
> > into some problems. Namely, it doesn't seem like any oscillation is
> > occurring. I've hooked up the output signal to LEDs and the serial port,
> > but neither of these shows any oscillations.

>
> *It is 'good practice' *when doing ring oscillators, to build them
> using
> alternate inverter/nand/inverter/nand + final inverter/nand and enable
> the nands from your reset.
>
> *This ensures it does start correctly, and also helps avoid the
> optimize away diseases...
>
> *Start with a LOT of elements in your ring, and calculate a delay for
> a pair, then revisit your element count.
> *Not many data sheets have these numbers... I guess they are scared
> designers might rely on the numbers.
>
> -jg


Jim, and others:

4 levels of logic in the "ring" delivers usable clock on most known
FPGA's (assuming it is real 4 levels of logic, that is not optimized
into single lut)

the clock from "4 LL ring oscillator" may be too high to be used as
main system clock, so its good practice to divide with F/F, and use
the divided clock for the rest of the system, or for more margin pre
divide by 4 or 8

the ring clock will be in the frequency range where 1 F/F safely
triggers (this clock may be over 200MHz! depend on family)

Antti



Reply With Quote
  #8 (permalink)  
Old 11-03-2009, 05:05 PM
Rob Gaddi
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Mon, 2 Nov 2009 09:20:45 -0500
Sam Kerr <[email protected]> wrote:

> [snip a ring oscillator]


You know, for one pin, a tinylogic schmitt trigger, an R, and a C (sum
total < $0.10 in quantity), you could have a much easier to work with
clock source.

--
Rob Gaddi, Highland Technology
Email address is currently out of order
Reply With Quote
  #9 (permalink)  
Old 11-05-2009, 06:43 PM
Sam Kerr
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

Agreed, but the design I'm implementing is a Physically Unclonable
Function, which specifically calls for a ring oscillator.

-Sam Kerr

On Tue, 3 Nov 2009, Rob Gaddi wrote:

> On Mon, 2 Nov 2009 09:20:45 -0500
> Sam Kerr <[email protected]> wrote:
>
>> [snip a ring oscillator]

>
> You know, for one pin, a tinylogic schmitt trigger, an R, and a C (sum
> total < $0.10 in quantity), you could have a much easier to work with
> clock source.
>
> --
> Rob Gaddi, Highland Technology
> Email address is currently out of order
>

Reply With Quote
  #10 (permalink)  
Old 11-05-2009, 07:05 PM
Antti
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Nov 5, 7:43*pm, Sam Kerr <stk...@purdue.edu> wrote:
> Agreed, but the design I'm implementing is a Physically Unclonable
> Function, which specifically calls for a ring oscillator.
>
> -Sam Kerr
>
>
>
> On Tue, 3 Nov 2009, Rob Gaddi wrote:
> > On Mon, 2 Nov 2009 09:20:45 -0500
> > Sam Kerr <stk...@purdue.edu> wrote:

>
> >> [snip a ring oscillator]

>
> > You know, for one pin, a tinylogic schmitt trigger, an R, and a C (sum
> > total < $0.10 in quantity), you could have a much easier to work with
> > clock source.

>
> > --
> > Rob Gaddi, Highland Technology
> > Email address is currently out of order


wau, a real PUF designer!

and how is it looking? There are plenty of tricks possible, but
i bet its not so easy to make it really reliable

Antti


Reply With Quote
  #11 (permalink)  
Old 11-05-2009, 07:41 PM
Krzysztof Kepa
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN


"Sam Kerr" <[email protected]> wrote in message
news:alpine.WNT.2.00.0911020916180.1072@stkerr-Vista...
> I'm trying to create a ring oscillator for my FPGA design but I've run
> into some problems. Namely, it doesn't seem like any oscillation is
> occurring. I've hooked up the output signal to LEDs and the serial port,
> but neither of these shows any oscillations.
>


Here you might find useful reference design:

A. Maiti, R. Nagesh, A. Reddy, P. Schaumont, "Physical Unclonable Function
and True Random Number Generator: a Compact and Scalable Implementation,"
19th Great Lakes Symposium on VLSI (GLSVLSI 2009), May 2009.
http://rijndael.ece.vt.edu/schaum/pa...009glsvlsi.pdf

>
> A few things I think might be happening is that the oscillation is so fast
> I just can't see it, the oscillation is too fast for the board, it's
> getting optimized out during synthesis, or (probably) my Verilog file is
> implemented incorrectly.
>


Constraining inverter's output signals with 'KEEP' attribute will do the
job.
Also, the oscillation frequency for 3 INVs can reach 450-500MHz (when
implemented in V5).

Regards,
Krzysztof


Reply With Quote
  #12 (permalink)  
Old 11-05-2009, 07:48 PM
Antti
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Nov 5, 8:41*pm, "Krzysztof Kepa" <nospam_blond...@poczta.fm> wrote:
> "Sam Kerr" <stk...@purdue.edu> wrote in message
>
> news:alpine.WNT.2.00.0911020916180.1072@stkerr-Vista...
>
> > I'm trying to create a ring oscillator for my FPGA design but I've run
> > into some problems. Namely, it doesn't seem like any oscillation is
> > occurring. I've hooked up the output signal to LEDs and the serial port,
> > but neither of these shows any oscillations.

>
> Here you might find useful reference design:
>
> A. Maiti, R. Nagesh, A. Reddy, P. Schaumont, "Physical Unclonable Function
> and True Random Number Generator: a Compact and Scalable Implementation,"
> 19th Great Lakes Symposium on VLSI (GLSVLSI 2009), May 2009.http://rijndael.ece.vt.edu/schaum/pa...009glsvlsi.pdf
>
>
>
> > A few things I think might be happening is that the oscillation is so fast
> > I just can't see it, the oscillation is too fast for the board, it's
> > getting optimized out during synthesis, or (probably) my Verilog file is
> > implemented incorrectly.

>
> Constraining inverter's output signals with 'KEEP' attribute will do the
> job.
> Also, the oscillation frequency for 3 INVs can reach 450-500MHz (when
> implemented in V5).
>
> Regards,
> Krzysztof


I was able to measure ring oscillator frequency of 975MHz in V4
(but that signal would not travel long in V4 fabric)

Antti


Reply With Quote
  #13 (permalink)  
Old 11-05-2009, 08:51 PM
Krzysztof Kepa
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN


"Antti" <[email protected]> wrote in message
news:[email protected]..
On Nov 5, 8:41 pm, "Krzysztof Kepa" <nospam_blond...@poczta.fm> wrote:
>> Also, the oscillation frequency for 3 INVs can reach 450-500MHz (when
>> implemented in V5).
>>

>I was able to measure ring oscillator frequency of 975MHz in V4
>(but that signal would not travel long in V4 fabric)
>
>Antti


Nice, was it on purpose?
I mean I'm just curious whether it required manual routing or simply 'just
happened' ?

Regards,
Krzysztof



Reply With Quote
  #14 (permalink)  
Old 11-05-2009, 09:27 PM
Antti
Guest
 
Posts: n/a
Default Re: Need some help creating a ring oscillator on a Spartan-3AN

On Nov 5, 9:51*pm, "Krzysztof Kepa" <nospam_blond...@poczta.fm> wrote:
> "Antti" <antti.luk...@googlemail.com> wrote in message
>
> news:[email protected]..
> On Nov 5, 8:41 pm, "Krzysztof Kepa" <nospam_blond...@poczta.fm> wrote:
>
> >> Also, the oscillation frequency for 3 INVs can reach 450-500MHz (when
> >> implemented in V5).

>
> >I was able to measure ring oscillator frequency of 975MHz in V4
> >(but that signal would not travel long in V4 fabric)

>
> >Antti

>
> Nice, was it on purpose?
> I mean I'm just curious whether it required manual routing or simply 'just
> happened' ?
>
> Regards,
> Krzysztof


on purpose yes

just "fabric" speed measurement experiments, and trying out different
primitives to be used as on-chip oscillators
I think i did use RLOCs at least, the 975mhz travels to closest Flip
flop that divides by two, the clock is otherwise
unuseable in V4, ah yes, this was done when i did write my FPGA
Frequency Meter IP cores and JTAG software
well, that software and IP cores still could be used but as it was
depending on LPT based JTAG adapter so it
not much useful now, well at least not with that mode that it was
used, where it was possible to measure
clocks connected to FPGA without having any known reference (JTAG
timing was used as reference)

Antti






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
Disable optimisation - Ring oscillator Franck Y FPGA 7 04-10-2008 10:33 AM
Putting the Ring into Ring oscillators Jim Granville FPGA 8 05-09-2006 11:29 PM
Oscillator for Digilent Spartan 3 Starter Kit kcl FPGA 5 02-02-2005 12:43 AM
Ring Oscillator Redux Kevin Neilson FPGA 5 09-23-2004 02:49 PM
ring oscillator calibration Siva Velusamy FPGA 9 08-27-2004 12:42 PM


All times are GMT +1. The time now is 04:14 AM.


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