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 10-30-2006, 06:06 PM
RishiD
Guest
 
Posts: n/a
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 .....

Reply With Quote
  #2 (permalink)  
Old 10-30-2006, 06:58 PM
Andy Peters
Guest
 
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

Reply With Quote
  #3 (permalink)  
Old 10-30-2006, 07:01 PM
KJ
Guest
 
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

Reply With Quote
  #4 (permalink)  
Old 10-30-2006, 07:04 PM
RishiD
Guest
 
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


Reply With Quote
  #5 (permalink)  
Old 11-02-2006, 12:00 PM
shrinath
Guest
 
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 .....


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
Workaround for installing EDK on Vista x64? Pete FPGA 6 08-22-2008 08:02 AM
FPGA quiz3, or where Antti did give up and does not know answer or acceptable workaround Antti FPGA 24 10-24-2007 11:30 AM
multisource on signal in XPS savs FPGA 9 06-27-2006 10:26 AM
Avoiding multisource in VHDL fpgawizz VHDL 4 04-11-2005 09:45 PM
comp.arch.fpga : Multisource databus evspronsen FPGA 2 02-27-2004 05:35 PM


All times are GMT +1. The time now is 04:45 PM.


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