EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

Clock Edge notation

elektroda.net NewsGroups Forum Index - VHDL Language - Clock Edge notation

Goto page Previous  1, 2, 3 ... 99, 100, 101 ... 103, 104, 105  Next

Serkan
Guest

Sat Jun 27, 2009 11:30 pm   



On 26 Haziran, 19:58, Mike Treseler <mtrese...@gmail.com> wrote:
Quote:
Serkan wrote:
 It takes two much time to simulate using that method.
 Is not there any way to do it without the testbench writing the
values?

Is your intent to test the ram design?
Finding the init data does not prove
that the ram works.

      -- Mike Treseler

No I do not want to test the ram. I have a design to test which has a
dpram. So I need a dpram model to help testing my design.
I created a ram(in my case dpram_32k) using the Xilinx Core
Generator.
I have a mif file that has the initial values to be entered to the ram
at the time 0 of test.(I do not want to do it on the testbench by
myself for timing purposes. This is important)
I just want to make a functinal simulation using Modelsim with the ram
initialized using the mif file that I have before the test starts.

I am missing something in the steps that I cant be able to initialize
the ram with the numbers in the milf file.

serkan

Fredxx
Guest

Sun Jun 28, 2009 1:13 am   



"Mike Treseler" <mtreseler_at_gmail.com> wrote in message
news:7akg5eF1tmmprU1_at_mid.individual.net...
Quote:
Fredxx wrote:

At the same time blind reliance of simulators is just as bad.

As is blind reliance on anything.

There is the old saying garbage in = garbage out.

An rtl sim is a pretty good garbage filter.
It is only sufficient with a well-tested set of design rules.

Hmm - perhaps you're interfacing with an external IC. Are you going to tell
me you'd blindly write a testbench without confirming that your interface in
real hardware is correctly understood?

It's clear you've never got a PCI or PCIe interface working without
resorting to the likes of chipscope, where reality doesn't even match
signals as per standards.

Quote:

In the past I have also come across instances where simulation has taken
so
long, and created such large files, that reality has been quicker with a
few
debugging flags in the code!

I have worked on projects where a few debugging
flags in the code would never have found
all of the logical errors.

Couldn't agree more.

Quote:

A good testbench doesn't produce large files.

I was thinking of waveform files, where perhaps the simulation has to first
wade though a million states to start providing data.

Quote:
It reports pass or fail.

You're just not living in the real world of FPGA design which ought to be a
mix of simulation and reality. Anything else, and you are either assuming
your test bench doesn't have any flaws, or just fumbling in the dark.

Mike Treseler
Guest

Sun Jun 28, 2009 1:43 pm   



Fredxx wrote:

Quote:
Hmm - perhaps you're interfacing with an external IC. Are you going to tell
me you'd blindly write a testbench without confirming that your interface in
real hardware is correctly understood?

Standard interfaces are well documented.
Certainly I have to verify a few things on the bench,
but starting with a sim improves my odds.

Quote:
It's clear you've never got a PCI or PCIe interface working without
resorting to the likes of chipscope, where reality doesn't even match
signals as per standards.

We purchased a PCIe core that came with a testbench.
I just worked.

-- Mike Treseler

Mike Treseler
Guest

Sun Jun 28, 2009 1:49 pm   



Mike Treseler wrote:

Quote:
We purchased a PCIe core that came with a testbench.
I just worked.

It

Fredxx
Guest

Sun Jun 28, 2009 2:07 pm   



"Mike Treseler" <mtreseler_at_gmail.com> wrote in message
news:4A477373.8040406_at_gmail.com...
Quote:
Fredxx wrote:

Hmm - perhaps you're interfacing with an external IC. Are you going to
tell me you'd blindly write a testbench without confirming that your
interface in real hardware is correctly understood?

Standard interfaces are well documented.
Certainly I have to verify a few things on the bench,
but starting with a sim improves my odds.

It sounds we're really singing from the same hymn sheet, the difference is
I'm more honest to say that simulation is sometimes no substitution for
reality.

Quote:

It's clear you've never got a PCI or PCIe interface working without
resorting to the likes of chipscope, where reality doesn't even match
signals as per standards.

We purchased a PCIe core that came with a testbench.
I just worked.


Perhaps I'm missing something here, but I would hope the purchased core and
test bench would work straight out of the box?

rickman
Guest

Tue Jun 30, 2009 4:24 pm   



On Jun 27, 9:13 pm, "Fredxx" <fre...@spam.com> wrote:
Quote:
"Mike Treseler" <mtrese...@gmail.com> wrote in message

news:7akg5eF1tmmprU1_at_mid.individual.net...

Fredxx wrote:

At the same time blind reliance of simulators is just as bad.

As is blind reliance on anything.

There is the old saying garbage in = garbage out.

An rtl sim is a pretty good garbage filter.
It is only sufficient with a well-tested set of design rules.

Hmm - perhaps you're interfacing with an external IC.  Are you going to tell
me you'd blindly write a testbench without confirming that your interface in
real hardware is correctly understood?

It's clear you've never got a PCI or PCIe interface working without
resorting to the likes of chipscope, where reality doesn't even match
signals as per standards.



In the past I have also come across instances where simulation has taken
so
long, and created such large files, that reality has been quicker with a
few
debugging flags in the code!

I have worked on projects where a few debugging
flags in the code would never have found
all of the logical errors.

Couldn't agree more.



A good testbench doesn't produce large files.

I was thinking of waveform files, where perhaps the simulation has to first
wade though a million states to start providing data.

It reports pass or fail.

You're just not living in the real world of FPGA design which ought to be a
mix of simulation and reality.  Anything else, and you are either assuming
your test bench doesn't have any flaws, or just fumbling in the dark.

Nobody is saying you never have to test a design in the chip. I think
Mike is just saying that time spent on a good test bench is work many
more hours in the lab with an O-scope. I know that my designs
typically are much harder to debug on the bench than in simulation. I
seldom get my test benches honed to the point of giving me a pass/fail
indication, but I know that I am going to be running them many more
times than once and construct them accordingly. In fact, I typically
design a test bench for each module and unit test before I integrate.
If the module changes during integration, I rework the unit test bench
to keep up with the changes. This can add greatly to module reuse as
well as helping to keep the bulk of debugging at a lower level where
it is easier to find and repair bugs.

The software community has a lot of good ideas that *do* apply to
writing HDL code. We just need to consider these ideas and use them
appropriately.

Rick

Mad I.D.
Guest

Sun Jul 26, 2009 2:42 pm   



On Jul 25, 6:11 pm, KJ <kkjenni...@sbcglobal.net> wrote:
/cut

Thank you very much for this excellent explanation !
And thank you Brian Drummond.


Greeting from Croatia (right now Smile)

Brian Drummond
Guest

Sun Jul 26, 2009 10:19 pm   



On Sun, 26 Jul 2009 05:42:47 -0700 (PDT), "Mad I.D." <madid87_at_gmail.com> wrote:

Quote:
On Jul 25, 6:11 pm, KJ <kkjenni...@sbcglobal.net> wrote:
/cut

Thank you very much for this excellent explanation !

Which only leaves one question un-answered... how did the XST manual get one of
these two examples wrong? (or alternatively, why is the error still there, after
no doubt several revisions of the document?)

All comments on Xilinx quality control apart; the error may have escaped
correction (possibly even detection) simply because latches are not commonly
used in FPGAs. Registers are far more commonly used; their more predictable
timing model makes them more generally useful, and it is normally better design
practice to use them.

As a result you are highly unlikely to come across bugs in the handling of
registers in the documentation or tools; however bugs are more likely in less
well trodden paths, such as latches.

It would be useful to open a Webcase on support.xilinx.com (if you are allowed;
e.g. if you are not a student) to report this error. Pursue it with the Xilinx
support team until they accept that it really is an error, and ask them for the
CR# (number of the change request) to correct this piece of documentation. This
may take a little time; some of their support team are excellent, but others do
not immediately see a problem unless it is very clearly expressed. This gives
you useful experience in dealing with Xilinx support, and eventually saves other
Xilinx users from confusion.

- Brian

KJ
Guest

Sat Aug 15, 2009 3:17 am   



On Aug 14, 6:36 pm, rickman <gnu...@gmail.com> wrote:
Quote:
I typically use down counters that are loaded with an initial value
and output a flag when reaching zero.  


I can't find this thread.  Anyone remember it and some keywords that
would let me find it?  There may be something wrong with Google
groups.  I search on "counter carry chain" and it finds *NO*

I think this is the link you're looking for. Andy's post from June 19
is the 8th one in the thread.

http://groups.google.com/group/comp.lang.vhdl/browse_frm/thread/36d7833968f3e102/452a230826d347aa?q=down+counter+%22Andy%22+group:comp.lang.vhdl

Kevin Jennings

rickman
Guest

Sun Aug 16, 2009 5:13 am   



On Aug 14, 9:17 pm, KJ <kkjenni...@sbcglobal.net> wrote:
Quote:
On Aug 14, 6:36 pm, rickman <gnu...@gmail.com> wrote:

I typically use down counters that are loaded with an initial value
and output a flag when reaching zero.

I can't find this thread. Anyone remember it and some keywords that
would let me find it? There may be something wrong with Google
groups. I search on "counter carry chain" and it finds *NO*

I think this is the link you're looking for. Andy's post from June 19
is the 8th one in the thread.

http://groups.google.com/group/comp.lang.vhdl/browse_frm/thread/36d78...

Kevin Jennings

I guess that is the one. I don't see where they brought out the carry
flag to use elsewhere though and when I implement this, I get two
adders and the one generating the term count uses extra logic just to
get the carry out of the chain. This is using the Lattice tools in
their XP parts.

I seem to recall making this work by adding an extra bit to the input
value and separating the msb of the output as the carry. I'll give
that a try.

Rick

Brian Davis
Guest

Sun Aug 16, 2009 4:18 pm   



On Aug 15, 10:13 pm, rickman <gnu...@gmail.com> wrote:
Quote:

I seem to recall making this work by adding an extra bit to the input
value and separating the msb of the output as the carry. I'll give
that a try.

Not specific to your down counter problem, but I posted a

snippet a few years back that showed operand padding to
pull out the carry/overflow:

http://www.fpga-faq.com/archives/99500.html#99517

I'd first seen that in another post years ago,
that I can't locate anymore...

I've also noticed troubles with the google archive search,
I've been using the archive search on fpga-faq.com instead

http://www.fpga-faq.com/archives/index.html

Brian

Andy
Guest

Sun Aug 16, 2009 7:26 pm   



On Aug 14, 8:17 pm, KJ <kkjenni...@sbcglobal.net> wrote:
Quote:
On Aug 14, 6:36 pm, rickman <gnu...@gmail.com> wrote:

I typically use down counters that are loaded with an initial value
and output a flag when reaching zero.  

I can't find this thread.  Anyone remember it and some keywords that
would let me find it?  There may be something wrong with Google
groups.  I search on "counter carry chain" and it finds *NO*

I think this is the link you're looking for.  Andy's post from June 19
is the 8th one in the thread.

http://groups.google.com/group/comp.lang.vhdl/browse_frm/thread/36d78...

Kevin Jennings

Wow, what's old is new again...

I should note that since then, I have noticed that while the RTL view
from Synplify indicates using the next bit (carry), the technology
view sometimes comes up with something better, not necessarily using
the carry chain the way one would expect.

That said, I have never seen it do worse than a "count = 0"
comparison.

Also be aware that the "count - 1 < 0" (or "count + 1 > 2**n-1") trick
only works with integer types, not with unsigned vector types.

Andy

JimLewis
Guest

Mon Aug 17, 2009 6:15 pm   



Hi Rick,
Integers and such are great for sim run time, however, if you are not
getting the hardware you want, here is an array based algorithm that
only uses one carry cell to implement the zero detect. It has a few
extras that you may want to remove. BaseReg is the loadable base
register. CntReg keeps the current count value. IntReg is a
registered version of the zero detect.

Best,
Jim
SynthWorks VHDL training


TimerProc : process (Clk, nReset)
variable Dec : unsigned(CntReg'Length downto 0) ;
begin
if (nReset = '0') then
BaseReg <= (others => '0') ;
CntReg <= (others => '0') ;
IntReg <= '0' ;
elsif rising_edge(Clk) then
if (TimerSel = '1' and Read = '0') then
BaseReg <= unsigned(DataIn) ;
end if ;
Dec := ('0' & CntReg) - 1 ;
if (Dec(Dec'Left) = '1') then
CntReg <= BaseReg ;
else
CntReg <= Dec(CntReg'Range);
end if ;
IntReg <= Dec(Dec'Left) ;
end if ;
end process ;

Andy
Guest

Mon Aug 17, 2009 8:12 pm   



That's about the cleanest example using vectors I've seen.

I'm not sure it wouldn't be subject to the same final optimizations
from Synplify (et al?), since those optimizations were related more to
the entire carry chain than to just the end of it. Although outputting
the carry bit in the IntReg register would likely give it a strong
nudge towards preserving the carry bit intact (if not the entire
chain). I've not checked any results from integer-coded
implementations that also registered (count - 1 < 0) as a boolean
output.

Be careful if CntReg'Range is not "n downto 0".

Andy

rickman
Guest

Tue Aug 18, 2009 3:46 am   



On Aug 17, 12:15 pm, JimLewis <J...@SynthWorks.com> wrote:
Quote:
Hi Rick,
Integers and such are great for sim run time, however, if you are not
getting the hardware you want, here is an array based algorithm that
only uses one carry cell to implement the zero detect. It has a few
extras that you may want to remove. BaseReg is the loadable base
register. CntReg keeps the current count value. IntReg is a
registered version of the zero detect.

Best,
Jim
SynthWorks VHDL training

TimerProc : process (Clk, nReset)
variable Dec : unsigned(CntReg'Length downto 0) ;
begin
if (nReset = '0') then
BaseReg <= (others => '0') ;
CntReg <= (others => '0') ;
IntReg <= '0' ;
elsif rising_edge(Clk) then
if (TimerSel = '1' and Read = '0') then
BaseReg <= unsigned(DataIn) ;
end if ;
Dec := ('0' & CntReg) - 1 ;
if (Dec(Dec'Left) = '1') then
CntReg <= BaseReg ;
else
CntReg <= Dec(CntReg'Range);
end if ;
IntReg <= Dec(Dec'Left) ;
end if ;
end process ;

I don't have any problem getting the basic counter to use the carry
chain, but I can not get the carry out for other purposes. The result
seems to depend on size and how the tool is invoked. If I use the
Lattice tool, an 8 bit counter uses 3 LUTs to detect the terminal
count. At 16 bits it duplicates the adder chain and pulls off the
carry out. Using Synplify directly the technology view shows two
adders while the RTL view shows one adder with 24 bits. The carry
comes out of the top and the lower N bits are used for the counter.
Go figure...

Rick

Goto page Previous  1, 2, 3 ... 99, 100, 101 ... 103, 104, 105  Next

elektroda.net NewsGroups Forum Index - VHDL Language - Clock Edge notation

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony