Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Multisource Signal workaround

 
Thread Tools Search this Thread
Old 10-30-2006, 06:06 PM   #1
Default Multisource Signal workaround


Hi,

Making a FSM in VHDL. Problem is my tlCount and pauseCount has two
drivers, one in state_reg process and one in the next_state_logic
process. I cannot seem a good way to fix this but still keep them
seperated, I don't want to combine the state_reg process and
next_state_logic process into one. Need to keep the code clean.

Thanks for the help,

Rishi

state_reg:
process (clk, reset) begin
if (reset = '1') then
CURRENT_STATE <= Zero;
tlCount <= 0;
pauseCount <= 0;
elsif (clk'event and clk = '1') then
CURRENT_STATE <= NEXT_STATE;
tlCount <= tlCount + 1;
pauseCount <= pauseCount + 1;
end if;
end process;

next_state_logic:
process (CURRENT_STATE, NSsensor, EWsensor) begin
case CURRENT_STATE is
when Zero => NEXT_STATE <= NSg;
when NSg =>
if (tlCount >= 30 and EWsensor) then
NEXT_STATE <= NSpause;
pauseCount <= 0;
elsif (tlCount = 60) then
NEXT_STATE <= NSy;
tlCount <= 0;
else
NEXT_STATE <= NSg;
end if;
............
end case;
end process;

output_logic:
process (CURRENT_STATE) begin .....



RishiD
  Reply With Quote
Old 10-30-2006, 06:58 PM   #2
Andy Peters
 
Posts: n/a
Default Re: Multisource Signal workaround
RishiD wrote:
> Making a FSM in VHDL. Problem is my tlCount and pauseCount has two
> drivers, one in state_reg process and one in the next_state_logic
> process. I cannot seem a good way to fix this but still keep them
> seperated,


> I don't want to combine the state_reg process and
> next_state_logic process into one.


Why not? It makes the most sense.

-a



Andy Peters
  Reply With Quote
Old 10-30-2006, 07:01 PM   #3
KJ
 
Posts: n/a
Default Re: Multisource Signal workaround

RishiD wrote:
> Hi,
>
> Making a FSM in VHDL. Problem is my tlCount and pauseCount has two
> drivers, one in state_reg process and one in the next_state_logic
> process.

Can't do that.
> I cannot seem a good way to fix this but still keep them
> seperated,

Keep trying until you do. Your choices are:
1. Combine them into a single process
2. Have each process generate new signals that then get used by yet
another process to update tlCount and pauseCount instead of having each
process try to update them directly.

> I don't want to combine the state_reg process and
> next_state_logic process into one. Need to keep the code clean.

'Cleaniness' is at best second priority to 'working'.

Might also want to get rid of any unclocked processes and lump them
into clocked one...generally that makes thing cleaner in my book.

KJ



KJ
  Reply With Quote
Old 10-30-2006, 07:04 PM   #4
RishiD
 
Posts: n/a
Default Re: Multisource Signal workaround
Thanks for the input. Did some further thinking and the most logical
way is to combined the processes.

RishiD

KJ wrote:
> RishiD wrote:
> > Hi,
> >
> > Making a FSM in VHDL. Problem is my tlCount and pauseCount has two
> > drivers, one in state_reg process and one in the next_state_logic
> > process.

> Can't do that.
> > I cannot seem a good way to fix this but still keep them
> > seperated,

> Keep trying until you do. Your choices are:
> 1. Combine them into a single process
> 2. Have each process generate new signals that then get used by yet
> another process to update tlCount and pauseCount instead of having each
> process try to update them directly.
>
> > I don't want to combine the state_reg process and
> > next_state_logic process into one. Need to keep the code clean.

> 'Cleaniness' is at best second priority to 'working'.
>
> Might also want to get rid of any unclocked processes and lump them
> into clocked one...generally that makes thing cleaner in my book.
>
> KJ




RishiD
  Reply With Quote
Old 11-02-2006, 12:00 PM   #5
shrinath
 
Posts: n/a
Default Re: Multisource Signal workaround
Try to write same in single process

like this

state_reg:
process (clk, reset) begin
if (reset = '1') then
CURRENT_STATE <= Zero;
--tlCount <= 0;
--pauseCount <= 0;
elsif (clk'event and clk = '1') then
CURRENT_STATE <= NEXT_STATE;
--tlCount <= tlCount + 1;
--pauseCount <= pauseCount + 1;
end if;
end process;

next_state_logic:
process (CURRENT_STATE, NSsensor, EWsensor) begin
case CURRENT_STATE is
when Zero => NEXT_STATE <= NSg;

tlCount <= 0;
pauseCount <= 0;


when NSg =>


if
(tlCount >= 30 and EWsensor) then NEXT_STATE <= NSpause;
pauseCount <= 0;
elsif (tlCount = 60) then
NEXT_STATE <= NSy;
tlCount <= 0; else
NEXT_STATE <= NSg;

tlCount <= tlCount + 1;
pauseCount <= pauseCount + 1;

end if;
............
end case; end process;

i think this will solve the multisourcing,

shreenath

RishiD wrote:
> Hi,
>
> Making a FSM in VHDL. Problem is my tlCount and pauseCount has two
> drivers, one in state_reg process and one in the next_state_logic
> process. I cannot seem a good way to fix this but still keep them
> seperated, I don't want to combine the state_reg process and
> next_state_logic process into one. Need to keep the code clean.
>
> Thanks for the help,
>
> Rishi
>
> state_reg:
> process (clk, reset) begin
> if (reset = '1') then
> CURRENT_STATE <= Zero;
> tlCount <= 0;
> pauseCount <= 0;
> elsif (clk'event and clk = '1') then
> CURRENT_STATE <= NEXT_STATE;
> tlCount <= tlCount + 1;
> pauseCount <= pauseCount + 1;
> end if;
> end process;
>
> next_state_logic:
> process (CURRENT_STATE, NSsensor, EWsensor) begin
> case CURRENT_STATE is
> when Zero => NEXT_STATE <= NSg;
> when NSg =>
> if (tlCount >= 30 and EWsensor) then
> NEXT_STATE <= NSpause;
> pauseCount <= 0;
> elsif (tlCount = 60) then
> NEXT_STATE <= NSy;
> tlCount <= 0;
> else
> NEXT_STATE <= NSg;
> end if;
> ............
> end case;
> end process;
>
> output_logic:
> process (CURRENT_STATE) begin .....




shrinath
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
I am having trouble editing a signal in a sub program. Haai Hardware 0 08-28-2007 02:58 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM
IMHO, Digital SECAM video is better than Analog NTSC video Radium DVD Video 167 10-25-2006 04:16 AM
Convert S-video to RF signal Monkey Monkey DVD Video 10 01-14-2004 08:17 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46