reseting all signals with vhdl

A

Alfreeeeed

Guest
Hi , I need help with some VHDL issue I have right now. I have to
reset all signals of a digital filter when a process detects a change
in the reset port. Is there any short way to do this besides assigning
each signal a zero value? I have approx. 30 signals so doing that will
be a waste , dont you think?.

Regards
 
"Alfreeeeed" <Alfredo.Taddei@gmail.com> wrote in message
news:2836f8e3-7475-4924-84c5-caf21aceed8a@e4g2000hsg.googlegroups.com...
Hi , I need help with some VHDL issue I have right now. I have to
reset all signals of a digital filter when a process detects a change
in the reset port. Is there any short way to do this besides assigning
each signal a zero value? I have approx. 30 signals so doing that will
be a waste , dont you think?.

Regards
Turn the power off.
HTH., Syms.
 
On Feb 1, 8:06 am, "Symon" <symon_bre...@hotmail.com> wrote:
"Alfreeeeed" <Alfredo.Tad...@gmail.com> wrote in message

news:2836f8e3-7475-4924-84c5-caf21aceed8a@e4g2000hsg.googlegroups.com...

Hi , I need help with some VHDL issue I have right now. I have to
reset all signals of a digital filter when a process detects a change
in the reset port. Is there any short way to do this besides assigning
each signal a zero value? I have approx. 30 signals so doing that will
be a waste , dont you think?.

Regards

Turn the power off.
HTH., Syms.
Sounds funny and interesting , but how do I program that in VHDL?
 
...I have to reset all signals of a digital filter...Is there any
short way to do this besides assigning each signal a zero value?
...approx. 30 signals so doing that will be a waste, dont you think?
A waste of what?
 
On Feb 1, 10:52 am, MikeShepherd...@btinternet.com wrote:
...I have to reset all signals of a digital filter...Is there any
short way to do this besides assigning each signal a zero value?
...approx. 30 signals so doing that will be a waste, dont you think?

A waste of what?
A waste of time , writing each line for each signal assignment. I am
looking for effective code writing;
 
On Fri, 1 Feb 2008 06:42:13 -0800 (PST), Alfreeeeed
<Alfredo.Taddei@gmail.com> wrote:

On Feb 1, 10:52 am, MikeShepherd...@btinternet.com wrote:
...I have to reset all signals of a digital filter...Is there any
short way to do this besides assigning each signal a zero value?
...approx. 30 signals so doing that will be a waste, dont you think?

A waste of what?

A waste of time , writing each line for each signal assignment. I am
looking for effective code writing;
I think that, if we're to make progress with your idea, we need more
precision of expression. Do you really mean that you want to save
time in writing or do you want to save time for the reader?

I see a great deal of code which expresses the first (contemptible)
aim at the expense of the second (which is laudable).

Mike
 
Alfreeeeed wrote:

A waste of time , writing each line for each signal assignment. I am
looking for effective code writing;
Not so bad.

procedure init_regs is
begin
zero_read_data;
serial_out_v := '1'; -- no premature start bit
RxState_v := IDLE;
TxState_v := IDLE;
Tx_v := (others => '0');
Rx_v := (others => '0');
serialInRetimed_v := ('1', '1', '1'); -- no premature start bit
RxBitSampleCount_v := 0;
RxBitCount_v := 0;
TxBitSampleCount_v := 0;
TxBitCount_v := 0;
sample_tp_sim_only_v := false;
end procedure init_regs;

from http://home.comcast.net/~mike_treseler/uart.vhd
 
On Feb 1, 10:35 am, MikeShepherd...@btinternet.com wrote:
On Fri, 1 Feb 2008 06:42:13 -0800 (PST), Alfreeeeed

Alfredo.Tad...@gmail.com> wrote:
On Feb 1, 10:52 am, MikeShepherd...@btinternet.com wrote:
...I have to reset all signals of a digital filter...Is there any
short way to do this besides assigning each signal a zero value?
...approx. 30 signals so doing that will be a waste, dont you think?

A waste of what?

A waste of time , writing each line for each signal assignment. I am
looking for effective code writing;

I think that, if we're to make progress with your idea, we need more
precision of expression. Do you really mean that you want to save
time in writing or do you want to save time for the reader?

I see a great deal of code which expresses the first (contemptible)
aim at the expense of the second (which is laudable).

Mike
Afre*d, how about posting the code you want to fix? If you have a 30-
tap FIR filter that's written as 30 separate lines of code, I can tell
you right off you should change your coding style to use generates or
more effective parameterization. Doing this, you will introduce
opportunities for conciseness which will help you express your reset
better. On the other hand, if you have a rat's net of control logic,
all of which must be individually reset, you have a different
restructuring problem. You can also do some creative things with
record types and constructor functions to make your code both more
readable and easy to modify. But without seeing more specifics, it's
hard to give a useful response.

- Kenn
 
<MikeShepherd564@btinternet.com> wrote in message
news:toe6q35r615kmvr6v12lkgb9nbli4m53v3@4ax.com...
I think that, if we're to make progress with your idea, we need more
precision of expression. Do you really mean that you want to save
time in writing or do you want to save time for the reader?

Hi Mike,
My guess is the OP wants to save writing time. As someone who suffers from a
name spelling problem, I think he's probably still annoyed with his parents'
decision to add four extra 'e's into his name, which must add up to a lot of
extra typing over a lifetime.
Cheers, Syms.
 
On Feb 1, 12:50 pm, kennheinr...@sympatico.ca wrote:
On Feb 1, 10:35 am, MikeShepherd...@btinternet.com wrote:

On Fri, 1 Feb 2008 06:42:13 -0800 (PST), Alfreeeeed

Alfredo.Tad...@gmail.com> wrote:
On Feb 1, 10:52 am, MikeShepherd...@btinternet.com wrote:
...I have to reset all signals of a digital filter...Is there any
short way to do this besides assigning each signal a zero value?
...approx. 30 signals so doing that will be a waste, dont you think?

A waste of what?

A waste of time , writing each line for each signal assignment. I am
looking for effective code writing;

I think that, if we're to make progress with your idea, we need more
precision of expression. Do you really mean that you want to save
time in writing or do you want to save time for the reader?

I see a great deal of code which expresses the first (contemptible)
aim at the expense of the second (which is laudable).

Mike

Afre*d, how about posting the code you want to fix? If you have a 30-
tap FIR filter that's written as 30 separate lines of code, I can tell
you right off you should change your coding style to use generates or
more effective parameterization. Doing this, you will introduce
opportunities for conciseness which will help you express your reset
better. On the other hand, if you have a rat's net of control logic,
all of which must be individually reset, you have a different
restructuring problem. You can also do some creative things with
record types and constructor functions to make your code both more
readable and easy to modify. But without seeing more specifics, it's
hard to give a useful response.

- Kenn
Thanks everybody for the feedback , I will try to be more clear this
time. I have an IIR SOS filter with 4 sections.
each section has 10 signals aproximately. The coefficients of the
multipliers are variable depending on the selected channel. What I am
trying to implement is a reset of all the signals of all the sections
so that when the new filter is selected , every signal of the filter
is clear. The first idea that comes in my mind to do these is a
process sensitive to a reset pin. -- The following is a quick
example , my code doesnt look like this--


process (reset)
begin
if ( reset'event and reset'last_value='0') then
signal_1<=(others => '0');

signal_2<=(others => '0');

signal_3<=(others => '0');

signal_4<=(others => '0');

signal_5<=(others => '0');



......etc etc until we reach the 40 signals.

end if;
end process;


So , any suggestions????

Thanks a lot
 
On Feb 1, 12:00 pm, Alfreeeeed <Alfredo.Tad...@gmail.com> wrote:
On Feb 1, 12:50 pm, kennheinr...@sympatico.ca wrote:
snip
Thanks everybody for the feedback , I will try to be more clear this
time.  I have an IIR SOS filter with 4 sections.
each section has 10 signals aproximately. The coefficients of the
multipliers are variable depending on the selected channel. What I am
trying to implement is a reset of all the signals of all the sections
so that when the new filter is selected , every signal of the filter
is clear.
The first question that comes to mind is 'Why do you think it's
important to reset all of these signals?'...and before you or someone
else says 'So that I know what state they are in' let me just say that
in general, data signals do not need to be initialized at all at
reset, and many times, only a small subset of control signals need to
be initialized at reset.

Get over the urge to reset everything, it is counterproductive and
wastes resources. Since your concern is the 'wasting time typing' to
put in the code to reset everything, you should instead put some
thought into figuring out just what signals really do need to be reset
instead...you'll find that very few of them need it.

The first idea that comes in my mind to do these is a
process sensitive to a reset pin. -- The following is a quick
example , my code doesnt look like this--
You'll need to get another idea. You will never use reset as a clock
type signal as you've shown in your code. Use a synchronous process
template

process(Clock)
begin
if rising_edge(Clock) then
if (Reset = '1') then
-- Reset signals here
else
-- normal operation here
end if;
end if;
end process;

Lastly, simulate your design (once you have it coded up).

Kevin Jennings
 
On Fri, 1 Feb 2008 06:42:13 -0800 (PST), Alfreeeeed <Alfredo.Taddei@gmail.com>
wrote:

On Feb 1, 10:52 am, MikeShepherd...@btinternet.com wrote:
...I have to reset all signals of a digital filter...Is there any
short way to do this besides assigning each signal a zero value?
...approx. 30 signals so doing that will be a waste, dont you think?

A waste of what?

A waste of time , writing each line for each signal assignment. I am
looking for effective code writing;
Using an array (or conceivably record) containing all these signals, you could
reset them all with a single assignment.

You don't say what kind of digital filter, but an array would be ideal for an
FIR, and a small array of records would probably suit a chain of second order
IIR stages..

Use the type system to help you express what you are doing as clearly and
concisely as possible.

- Brian
 
On Fri, 1 Feb 2008 09:23:31 -0800 (PST), KJ <kkjennings@sbcglobal.net> wrote:

On Feb 1, 12:00 pm, Alfreeeeed <Alfredo.Tad...@gmail.com> wrote:
On Feb 1, 12:50 pm, kennheinr...@sympatico.ca wrote:
snip
Thanks everybody for the feedback , I will try to be more clear this
time.  I have an IIR SOS filter with 4 sections.
each section has 10 signals aproximately. The coefficients of the
multipliers are variable depending on the selected channel. What I am
trying to implement is a reset of all the signals of all the sections
so that when the new filter is selected , every signal of the filter
is clear.

The first question that comes to mind is 'Why do you think it's
important to reset all of these signals?'...and before you or someone
else says 'So that I know what state they are in'
in an IIR filter it's quite likely that avoiding transient outputs when
switching from one filter section to another is important.

Normal signal values for one filter could cause overload (and oscillation) for
another. Knowing the initial state may be unimportant, but proving it is both
linear and stable is another matter.

- Brian
 
Alfreeeeed a écrit :

Thanks everybody for the feedback , I will try to be more clear this
time. I have an IIR SOS filter with 4 sections.
each section has 10 signals aproximately. The coefficients of the
multipliers are variable depending on the selected channel. What I am
trying to implement is a reset of all the signals of all the sections
so that when the new filter is selected , every signal of the filter
is clear. The first idea that comes in my mind to do these is a
process sensitive to a reset pin. -- The following is a quick
example , my code doesnt look like this--


process (reset)
begin
if ( reset'event and reset'last_value='0') then
signal_1<=(others => '0');
signal_2<=(others => '0');
signal_3<=(others => '0');
signal_4<=(others => '0');
signal_5<=(others => '0');
.....etc etc until we reach the 40 signals.

end if;
end process;

So , any suggestions????

Hi
As has already been suggested, define an array instead of individual
signals.
The reset will be only one line :
signal <= (others => (others => '0'));

And if you need more (or less) signals, you only have to change your
array size.

Nicolas
 
"Brian Drummond" <brian_drummond@btconnect.com> wrote in message
news:5aj8q35hmos3vfbtqfp4utdr4jvujl1qek@4ax.com...
On Fri, 1 Feb 2008 09:23:31 -0800 (PST), KJ <kkjennings@sbcglobal.net
wrote:

On Feb 1, 12:00 pm, Alfreeeeed <Alfredo.Tad...@gmail.com> wrote:
On Feb 1, 12:50 pm, kennheinr...@sympatico.ca wrote:
snip
Thanks everybody for the feedback , I will try to be more clear this
time. I have an IIR SOS filter with 4 sections.
each section has 10 signals aproximately. The coefficients of the
multipliers are variable depending on the selected channel. What I am
trying to implement is a reset of all the signals of all the sections
so that when the new filter is selected , every signal of the filter
is clear.

The first question that comes to mind is 'Why do you think it's
important to reset all of these signals?'...and before you or someone
else says 'So that I know what state they are in'

in an IIR filter it's quite likely that avoiding transient outputs when
switching from one filter section to another is important.

I agree that the state values of the IIR would end up on the list of signals
that would need to be initialized. If the one writing the code to implement
the IIR didn't know much about IIR (and didn't consider why the states
holding the previous values would need some form of initialization) then
they would find it pretty quickly in simulation since the output of the IIR
would always be unknown. Signals such as these are the ones that require a
designed in way to be initialized, most other signals do not.

Normal signal values for one filter could cause overload (and oscillation)
for
another. Knowing the initial state may be unimportant, but proving it is
both
linear and stable is another matter.

Initial values do not affect stability of an IIR.

Stability can be (dis)proven by simple analysis to make sure that the poles
all end up inside the unit circle. Not doing this analysis prior to
implementation in any form is asking to waste time.

The switching of coefficients based on the channel (which the OP says he's
trying to do) should not affect stability, he should be switching between
sets that all form a stable IIR design.

Kevin Jennings
 
In message <5aj8q35hmos3vfbtqfp4utdr4jvujl1qek@4ax.com>
Brian Drummond <brian_drummond@btconnect.com> wrote:

On Fri, 1 Feb 2008 09:23:31 -0800 (PST), KJ <kkjennings@sbcglobal.net
wrote:

The first question that comes to mind is 'Why do you think it's important
to reset all of these signals?'...and before you or someone else says 'So
that I know what state they are in'

in an IIR filter it's quite likely that avoiding transient outputs when
switching from one filter section to another is important.
but if you reset all the registers, you will /introduce/ a
transient if the value passing through the filter is non-zero.

Dave
 
On Feb 2, 7:32 pm, Dave Higton <davehig...@dsl.pipex.com> wrote:
In message <5aj8q35hmos3vfbtqfp4utdr4jvujl1...@4ax.com
Brian Drummond <brian_drumm...@btconnect.com> wrote:

On Fri, 1 Feb 2008 09:23:31 -0800 (PST), KJ <kkjenni...@sbcglobal.net
wrote:

The first question that comes to mind is 'Why do you think it's important
to reset all of these signals?'...and before you or someone else says 'So
that I know what state they are in'

in an IIR filter it's quite likely that avoiding transient outputs when
switching from one filter section to another is important.

but if you reset all the registers, you will /introduce/ a
transient if the value passing through the filter is non-zero.

Dave
Ok , so basically what I need to do is declare all my signals in an
array or if needed in record types so the reseting code for the
signals would be at most the number of arrays declared. Is that right?

On the other hand, I am not sure if I really need to reset my signals
if I am changing coefficients. I believe I must to. Specially because
of the type of application. Its a bandpass filter for a TETRA
repeater. This channel would be switched at most once every week. So
it would be like switching the power off. Anyway , I really would like
to know
if it is necesary reseting signals.

Cheers
 
In message
<4c75d645-8f8f-42a8-8dd2-12df14f4b30c@m34g2000hsb.googlegroups.com>
Alfreeeeed <Alfredo.Taddei@gmail.com> wrote:

On Feb 2, 7:32 pm, Dave Higton <davehig...@dsl.pipex.com> wrote:
In message <5aj8q35hmos3vfbtqfp4utdr4jvujl1...@4ax.com
Brian Drummond <brian_drumm...@btconnect.com> wrote:

On Fri, 1 Feb 2008 09:23:31 -0800 (PST), KJ <kkjenni...@sbcglobal.net
wrote:

The first question that comes to mind is 'Why do you think it's
important to reset all of these signals?'...and before you or someone
else says 'So that I know what state they are in'

in an IIR filter it's quite likely that avoiding transient outputs when
switching from one filter section to another is important.

but if you reset all the registers, you will /introduce/ a transient if
the value passing through the filter is non-zero.

Dave

Ok , so basically what I need to do is declare all my signals in an array
or if needed in record types so the reseting code for the signals would be
at most the number of arrays declared. Is that right?
I'm not sure I understand your statement. Normally there is just one
reset /signal/. It isn't a code, it's a single line. You can apply
it to as many or as few registers as you wish.

On the other hand, I am not sure if I really need to reset my signals if I
am changing coefficients. I believe I must to. Specially because of the
type of application. Its a bandpass filter for a TETRA repeater. This
channel would be switched at most once every week. So it would be like
switching the power off. Anyway , I really would like to know if it is
necesary reseting signals.
Only you can answer that. Ask yourself these two questions:

1) What will happen if I don't reset the filter registers?

2) What will happen if I do reset the filter registers?

When you have analysed the system thoroughly, you should be able
to decide which course of action is better.

Dave
 
On Feb 4, 6:18 pm, Dave Higton <davehig...@dsl.pipex.com> wrote:
In message
4c75d645-8f8f-42a8-8dd2-12df14f4b...@m34g2000hsb.googlegroups.com
Alfreeeeed <Alfredo.Tad...@gmail.com> wrote:

On Feb 2, 7:32 pm, Dave Higton <davehig...@dsl.pipex.com> wrote:
In message <5aj8q35hmos3vfbtqfp4utdr4jvujl1...@4ax.com
Brian Drummond <brian_drumm...@btconnect.com> wrote:

On Fri, 1 Feb 2008 09:23:31 -0800 (PST), KJ <kkjenni...@sbcglobal.net
wrote:

The first question that comes to mind is 'Why do you think it's
important to reset all of these signals?'...and before you or someone
else says 'So that I know what state they are in'

in an IIR filter it's quite likely that avoiding transient outputs when
switching from one filter section to another is important.

but if you reset all the registers, you will /introduce/ a transient if
the value passing through the filter is non-zero.

Dave

Ok , so basically what I need to do is declare all my signals in an array
or if needed in record types so the reseting code for the signals would be
at most the number of arrays declared. Is that right?

I'm not sure I understand your statement. Normally there is just one
reset /signal/. It isn't a code, it's a single line. You can apply
it to as many or as few registers as you wish.

On the other hand, I am not sure if I really need to reset my signals if I
am changing coefficients. I believe I must to. Specially because of the
type of application. Its a bandpass filter for a TETRA repeater. This
channel would be switched at most once every week. So it would be like
switching the power off. Anyway , I really would like to know if it is
necesary reseting signals.

Only you can answer that. Ask yourself these two questions:

1) What will happen if I don't reset the filter registers?

2) What will happen if I do reset the filter registers?

When you have analysed the system thoroughly, you should be able
to decide which course of action is better.

Dave
Ok , that is what I am going to do right now. I will declare all the
registers in arrays and reset just them.
Thanks
 

Welcome to EDABoard.com

Sponsor

Back
Top