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 12-20-2003, 02:18 AM
Naveen R
Guest
 
Posts: n/a
Default VHDL global signals

VHDL gurus,

I am designing an FPGA using VHDL and I ran into a little problem.

My top level file is mytop.vhd and I instantiate numerous components.
One of the components is mycomp.vhd. A signal my_sig(15 downto 0) is
declared in the component architecture. However, this signal is not
part of the port map. How do I access this signal(s) in my top level
file? Does VHDL even support this?

One way of working around this problem is to list the signal in the
port map. However, this component is instantiated numerous times in my
top level file and I don?t need this signal for each instance.

I tried looking up references on the web but couldn?t find any useful
information. I would really appreciate if someone can suggest a
solution.

Thanks
Naveen.
Reply With Quote
  #2 (permalink)  
Old 12-20-2003, 12:47 PM
Walter Dvorak
Guest
 
Posts: n/a
Default Re: VHDL global signals

Naveen R <[email protected]> wrote:
> One way of working around this problem is to list the signal in the
> port map. However, this component is instantiated numerous times in my
> top level file and I don?t need this signal for each instance.


Thats no problem in general, you can leave the signal in the
port map open if you dont need it in all instantiated components.
i.e.:

inst_1_mycomp : mycomp port map (
my_sig => top_level_of_my_sig_from_inst_1,
[...]
);

inst_2_mycomp : mycomp port map (
my_sig => open,
[...]
);

WD
--
Reply With Quote
  #3 (permalink)  
Old 12-23-2003, 04:36 AM
Marcin
Guest
 
Posts: n/a
Default Re: VHDL global signals

Hi,

Add this signal to the port list.
You can simply skip it in the instantiation if you assign a value to
this port in component declaration.
component mycomp is
port (
....
my_sig : in std_logic_vector(15 downto 0) := (others => '0');
....
This implies also mapping by name in your instantiation.

If you need it to be an output you can always use 'open',

u0 : mycomp
port map (
.....
my_sig => open,
.....
)

Finally, if you really want to leave it as internal signal usually the
'force' command allows you to drive the signals not only from the top
level.

Marcin

[email protected] (Naveen R) wrote in message news:<[email protected] com>...
> VHDL gurus,
>
> I am designing an FPGA using VHDL and I ran into a little problem.
>
> My top level file is mytop.vhd and I instantiate numerous components.
> One of the components is mycomp.vhd. A signal my_sig(15 downto 0) is
> declared in the component architecture. However, this signal is not
> part of the port map. How do I access this signal(s) in my top level
> file? Does VHDL even support this?
>
> One way of working around this problem is to list the signal in the
> port map. However, this component is instantiated numerous times in my
> top level file and I don?t need this signal for each instance.
>
> I tried looking up references on the web but couldn?t find any useful
> information. I would really appreciate if someone can suggest a
> solution.
>
> Thanks
> Naveen.

Reply With Quote
  #4 (permalink)  
Old 12-23-2003, 05:08 PM
Tim Hubberstey
Guest
 
Posts: n/a
Default Re: VHDL global signals

Naveen R wrote:
>
> VHDL gurus,
>
> I am designing an FPGA using VHDL and I ran into a little problem.
>
> My top level file is mytop.vhd and I instantiate numerous components.
> One of the components is mycomp.vhd. A signal my_sig(15 downto 0) is
> declared in the component architecture. However, this signal is not
> part of the port map. How do I access this signal(s) in my top level
> file? Does VHDL even support this?


Not as part of the language. However, most simulators will allow you to
look at a signal anywhere in the hierarchy.

> One way of working around this problem is to list the signal in the
> port map. However, this component is instantiated numerous times in my
> top level file and I don?t need this signal for each instance.
>
> I tried looking up references on the web but couldn?t find any useful
> information. I would really appreciate if someone can suggest a
> solution.


You can define a signal in a package and include the package in both
your top-level and the file(s) you want to be able to look at. You can
then have access to the signals in any file where the package is
included, without using the port list.
--
Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com
Reply With Quote
  #5 (permalink)  
Old 12-24-2003, 04:41 AM
[email protected]
Guest
 
Posts: n/a
Default Re: VHDL global signals

Hello,
Just to mention that i tried ones the use of the global signals in a
package and it worked well in the simulation. The problem that you could
face will be with synthesis tools that don't implement yet all the VHDL
specification. May be some EDA like Synopsys or Cadence will do that but
for Synplify and Leonardo Spectrum it will not.
You'd better use your signal as a port and let it open if it's an output.
Good luck
Reply With Quote
  #6 (permalink)  
Old 12-24-2003, 05:29 AM
Tim Hubberstey
Guest
 
Posts: n/a
Default Re: VHDL global signals

[email protected] wrote:
>
> Hello,
> Just to mention that i tried ones the use of the global signals in a
> package and it worked well in the simulation. The problem that you could
> face will be with synthesis tools that don't implement yet all the VHDL
> specification. May be some EDA like Synopsys or Cadence will do that but
> for Synplify and Leonardo Spectrum it will not.
> You'd better use your signal as a port and let it open if it's an output.
> Good luck


I beg to differ . . . The current version of Synplify DOES support
synthesis of global signals because I've used this feature to bring a
debug port to my top level. I believe it worked in Xilinx XST as well
but I don't trust my memory and I can't say for sure. You might need to
do a top-down synthesis for it to work but I'm just guessing.
--
Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com
Reply With Quote
  #7 (permalink)  
Old 12-24-2003, 05:37 PM
[email protected]
Guest
 
Posts: n/a
Default Re: VHDL global signals

Hi tim,
I tried to syntesis a simple code using global signals withe synplify 7.3.3
pro at the lab. Same as for the 7.2 pro vesion that i tried before. This is
my example:
--the package
library ieee;
use ieee.std_logic_1164.all;
package my_package is
signal Q: std_logic; -- Global signal
end my_package;

--the entity
library ieee;
use ieee.std_logic_1164.all;
entity testg is
port (clk: in std_logic;
ins : in std_logic;
outs: out std_logic );
end testg;
architecture arch of testg is
--signal Q: std_logic;
begin
process(clk)
begin
if clk'event and clk='1' then
work.my_package.Q<=ins;
outs<=work.my_package.Q;
--Q<=ins;
--Outs<=Q;
end if;
end process;
end;
================================================== ===========
it give
Synplicity VHDL Compiler, version Compilers 7.3, Build 036R, built Oct 1
2003
Copyright (C) 1994-2002, Synplicity Inc. All Rights Reserved

@N:"C:\My_Designs\tes.vhd":5:7:5:11|Top entity is set to testg.
VHDL syntax check successful!
Synthesizing work.testg.arch
@E:Internal Error
Please call Synplicity Support (USA) at (408) 215-6000 or send
email including this log and test case to [email protected]
================================================== ==========

I'll try some other tools latter. Do u have any suggestion???
yours
Reply With Quote
  #8 (permalink)  
Old 12-24-2003, 07:12 PM
Tim Hubberstey
Guest
 
Posts: n/a
Default Re: VHDL global signals

[email protected] wrote:
>
> Hi tim,
> I tried to syntesis a simple code using global signals withe synplify 7.3.3
> pro at the lab. Same as for the 7.2 pro vesion that i tried before. This is
> my example:
> --the package
> library ieee;
> use ieee.std_logic_1164.all;
> package my_package is
> signal Q: std_logic; -- Global signal
> end my_package;
>
> --the entity
> library ieee;
> use ieee.std_logic_1164.all;
> entity testg is
> port (clk: in std_logic;
> ins : in std_logic;
> outs: out std_logic );
> end testg;
> architecture arch of testg is
> --signal Q: std_logic;
> begin
> process(clk)
> begin
> if clk'event and clk='1' then
> work.my_package.Q<=ins;
> outs<=work.my_package.Q;
> --Q<=ins;
> --Outs<=Q;
> end if;
> end process;
> end;
> ================================================== ===========
> it give
> Synplicity VHDL Compiler, version Compilers 7.3, Build 036R, built Oct 1
> 2003
> Copyright (C) 1994-2002, Synplicity Inc. All Rights Reserved
>
> @N:"C:\My_Designs\tes.vhd":5:7:5:11|Top entity is set to testg.
> VHDL syntax check successful!


This line suggests that Synplify is actually happy with the code but . .
..

> Synthesizing work.testg.arch
> @E:Internal Error


.. . . then blows up due to a bug.

> Please call Synplicity Support (USA) at (408) 215-6000 or send
> email including this log and test case to [email protected]
> ================================================== ==========


What you have here is a Synplify bug causing the synthesis to crash.
This doesn't mean that global signals don't work in general. I suggest
you do as it says and report the bug to Synplicity.

I did something different: I defined a global signal and assigned to it
( global_signal <= stuff; ) in a sub-module and then drove the data out
at the top level ( debug_out_pin <= global_signal; ). I ran it all the
way through the Synplicity and Xilinx tools and it appeared to work. I
haven't done anything further as I'm only now starting the coding for
the project (months of spec writing finally over, Yeah!!).
--
Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com
Reply With Quote
  #9 (permalink)  
Old 12-26-2003, 07:51 PM
Walter Dvorak
Guest
 
Posts: n/a
Default Re: VHDL global signals

[email protected] wrote:
> Synplicity VHDL Compiler, version Compilers 7.3, Build 036R, built Oct 1
> 2003
> @E:Internal Error


Your example crashed

Synplicity VHDL Compiler, version Compilers 7.3, Build 055R, built Oct 27 2003

too. Maybe this a bug in synplify.


And your example with xilinx XST produce:

Release 5.2.03i - xst F.31
[...]
Analyzing Entity <testg> (Architecture <arch>).
ERROR:Xst:839 - /tmp/junk/test.vhd line 24: Signal is not defined : 'q'.
24: work.my_package.Q<=ins;


WD
--
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
How do I xor two signals in VHDL? Teece FPGA 3 12-30-2008 12:40 PM
Does XST support global signals? EM FPGA 4 10-22-2008 03:04 AM
Non-global location constraints in Xilinx/XST using VHDL Sidney Cadot FPGA 0 09-22-2004 03:18 PM
VHDL in Xilinx : why this signal is regarded as Global Clock ? Jimmy FPGA 3 07-06-2004 04:31 PM
How do you initialize signals in VHDL? Madhu FPGA 4 01-07-2004 09:09 AM


All times are GMT +1. The time now is 06:18 PM.


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