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

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-16-2009, 04:52 PM
JSreeniv
Guest
 
Posts: n/a
Default Pulse counter verification in vhdl

Hi all,

I am presently working on verification and validation of pulse counter
(where i am having such 8 counters)
When i wrote a testbench in VHDL and checking the results in Modelsim
i am not getting desired results.
Here are the steps for vhdl code for simulation.

1.setting the por_n = 0 for 100 ns and release to por_n =1 (power on
reset)
2. Setting up bit 20 of inhibit_1 register to which enables the
functionality of Pulse_counter_0_results register/counter
3. checking the all registers before setting up the values: READ
operation for ZERO values
4. wait for 10 ns
5.Set up register for software defined period for first two bits
6.set up same register for Time base 100 ns on other two bits
6.Load the count value to 10 in a register
7.set the register for start measurement
8. wait for 1000 ns

9. Read the pulse_counter_0_results register after waiting above time
10. As well read the loadable count register after this waiting time
(where i am giving a continues pulse_din signal as a clock of 40 ns,
so i need to get total pulse count in results register as : 1000 ns/40
ns = 25 = 19(Hex)
11 after waiting for 100 ns time also i should get same desired values
which leads holding correct values in correspond results registers.
12. Stop measurement

But i am not getting that desired value instead i am getting only 14
counts.

The whole simulation also depends on two clocks : fpga_clk = 50 MHz,
and dsp_clk = 100 MHz,....

So if anyone give me some exposure on this simulation desired
results ....it will be very helpful.

Sreenivas

MITC - Bangalore
Reply With Quote
  #2 (permalink)  
Old 06-16-2009, 05:27 PM
Shannon
Guest
 
Posts: n/a
Default Re: Pulse counter verification in vhdl

On Jun 16, 7:52*am, JSreeniv <sreenivas.jyo...@gmail.com> wrote:
> Hi all,
>
> I am presently working on verification and validation of pulse counter
> (where i am having such 8 counters)
> When i wrote a testbench in VHDL and checking the results in Modelsim
> i am not getting desired results.
> Here are the steps for vhdl code for simulation.
>
> 1.setting the por_n = 0 for 100 ns and release to por_n =1 (power on
> reset)
> 2. Setting up bit 20 of inhibit_1 register to which enables the
> functionality of Pulse_counter_0_results register/counter
> 3. checking the all registers before setting up the values: READ
> operation for ZERO values
> 4. wait for 10 ns
> 5.Set up register for software defined period for first two bits
> 6.set up same register for Time base 100 ns on other two bits
> 6.Load the count value to 10 in a register
> 7.set the register for start measurement
> 8. wait for 1000 ns
>
> 9. Read the pulse_counter_0_results register after waiting above time
> 10. As well read the loadable count register after this waiting time
> (where i am giving a continues pulse_din signal as a clock of 40 ns,
> so i need to get total pulse count in results register as : 1000 ns/40
> ns = 25 = 19(Hex)
> 11 after waiting for 100 ns time also i should get same desired values
> which leads holding correct values in correspond results registers.
> 12. Stop measurement
>
> But i am not getting that desired value instead i am getting only 14
> counts.
>
> The whole simulation also depends on two clocks : fpga_clk = 50 MHz,
> and dsp_clk = 100 MHz,....
>
> So if anyone give me some exposure on this simulation desired
> results ....it will be very helpful.
>
> Sreenivas
>
> MITC - Bangalore


My guess would be a thrown Johnson Rod or bad timing on the Spitzer
Valve.

But seriously, I think I can speak for the group. There is little
chance we are going to be able to help with out some indication the
problem code or something. We can't possibly guess at where the
missing semicolon is otherwise.

Shannon
Reply With Quote
  #3 (permalink)  
Old 06-17-2009, 04:02 PM
JimLewis
Guest
 
Posts: n/a
Default Re: Pulse counter verification in vhdl

Sreenivas,
Add all signals to simulation waveform window.
Run simulation. Watch what did happen.
Start watching from the beginning. What went
right. What did not go right.
Postulate as to why. Add more signals if necessary
to prove your postulation.

Your counter may start running with an old value and not
load the new value until it rolls over. This would cause
a difference in startup than you may expect, but it may produce
correct steady state system behavior if it is tolerable
at the beginning to act this way. Often it is tolerable
because the software does not get to your programmable
counters right away anyway.

I usually make my programmable counters to have two
features. 1: Write counter, but do not reload until
roll over. 2: Write counter and reload immediately.
That way I have both possible features covered.

Best,
Jim

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
Counter verification john VHDL 3 03-01-2008 12:16 AM
About counter in VHDL [email protected] VHDL 5 04-27-2006 11:25 AM
VHDL PULSE COUNTER - PLS HELP crazy_kuts VHDL 1 03-30-2006 07:50 PM
Synchronous counter enable pulse length Tom Derham FPGA 23 09-25-2003 02:02 AM
can I do such a simplest counter in VHDL? walala VHDL 3 09-14-2003 10:05 PM


All times are GMT +1. The time now is 04:28 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