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 09-22-2006, 06:08 AM
Guest
 
Posts: n/a
Default doubt in variable passing in multiple process

let me say

i am having two processes
process(clk1) and process(clk2)


process(clk1)
variable x:natural:=0;
begin
if clk'event and clk='1' then
x := x+1;
end if
end process;

process(clk2)
begin
----
-------
-----
end process

in the 1st process x may be changed to some 10 let me say.
and i want that variable with changed value to be utilized in 2nd
process how can i do it.
if i declare variable x before process1 it is giving error that shared
variables only should be declared here.
thank you

Reply With Quote
  #2 (permalink)  
Old 09-22-2006, 06:12 AM
David Ashley
Guest
 
Posts: n/a
Default Re: doubt in variable passing in multiple process

[email protected] wrote:
> let me say
>
> i am having two processes
> process(clk1) and process(clk2)
>
>
> process(clk1)
> variable x:natural:=0;
> begin
> if clk'event and clk='1' then
> x := x+1;
> end if
> end process;
>
> process(clk2)
> begin
> ----
> -------
> -----
> end process
>
> in the 1st process x may be changed to some 10 let me say.
> and i want that variable with changed value to be utilized in 2nd
> process how can i do it.
> if i declare variable x before process1 it is giving error that shared
> variables only should be declared here.
> thank you
>


Dude there's gotta be a better way of learning the language. This
is too much hand holding, these are fundamental things in VHDL.
Read your book, work the examples. It's all there...

-Dave

--
David Ashley http://www.xdr.com/dash
Embedded linux, device drivers, system architecture
Reply With Quote
  #3 (permalink)  
Old 09-22-2006, 07:56 AM
alessandro basili
Guest
 
Posts: n/a
Default Re: doubt in variable passing in multiple process

Variable declared in a process are only available for that process. I
think you better study some more basics before approaching any project.

[email protected] wrote:
> let me say
>
> i am having two processes
> process(clk1) and process(clk2)
>
>
> process(clk1)
> variable x:natural:=0;
> begin
> if clk'event and clk='1' then
> x := x+1;
> end if
> end process;
>
> process(clk2)
> begin
> ----
> -------
> -----
> end process
>
> in the 1st process x may be changed to some 10 let me say.
> and i want that variable with changed value to be utilized in 2nd
> process how can i do it.
> if i declare variable x before process1 it is giving error that shared
> variables only should be declared here.
> thank you
>

Reply With Quote
  #4 (permalink)  
Old 09-22-2006, 09:35 PM
Paul Uiterlinden
Guest
 
Posts: n/a
Default Re: doubt in variable passing in multiple process

[email protected] wrote:

> let me say
>
> i am having two processes
> process(clk1) and process(clk2)
>
>
> process(clk1)
> variable x:natural:=0;
> begin
> if clk'event and clk='1' then
> x := x+1;
> end if
> end process;
>
> process(clk2)
> begin
> ----
> -------
> -----
> end process
>
> in the 1st process x may be changed to some 10 let me say.
> and i want that variable with changed value to be utilized in 2nd
> process how can i do it.


Use a signal. Signals are the normal way for communication between
processes.

> if i declare variable x before process1 it is giving error that
> shared variables only should be declared here.
> thank you


Variables declared outside a process must be declared shared. But stay
away from shared variables as a beginner. With shared variables it is
possible to create non-deterministic behavior. So for now stay clear.
First learn the fundamentals of VHDL.

--
Paul.
Reply With Quote
  #5 (permalink)  
Old 10-02-2006, 08:32 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: doubt in variable passing in multiple process

Paul Uiterlinden wrote:

> Use a signal. Signals are the normal way for communication between
> processes.


Or do all of the logic using the variable x_v in the same process.
A process port assignment like
my_port <= x_v;
will then do the job without any interposed signals.

-- Mike Treseler
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
Variable or signal is driven in more than one process or block nike Verilog 2 09-22-2008 05:22 PM
Variable or signal driven in more than one process or block nike Verilog 0 09-20-2008 03:08 PM
doubt in process statement of vhdl [email protected] VHDL 3 09-22-2006 07:59 AM
doubt on VHDL process [email protected] VHDL 2 09-21-2006 09:25 AM
Process variable setup times and propogations Matt FPGA 5 07-03-2003 07:04 PM


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