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 07-27-2004, 04:01 PM
MM
Guest
 
Posts: n/a
Default kinda "overloading"

Hi all,

I have created a component with unconstrained std_logic_vector type input
and output. Can I make it work with std_logic as well? The component is
basically a pipeline of 2 FFs.

Thanks,
/Mikhail


Reply With Quote
  #2 (permalink)  
Old 07-28-2004, 04:45 PM
Jonathan Bromley
Guest
 
Posts: n/a
Default Re: kinda "overloading"

On Tue, 27 Jul 2004 11:01:03 -0400,
"MM" <[email protected]> wrote:

>I have created a component with unconstrained std_logic_vector type input
>and output. Can I make it work with std_logic as well? The component is
>basically a pipeline of 2 FFs.


No, but you can easily make it work with a single-element vector
port such as std_logic_vector(0 downto 0). You could then create
a one-element vector signal to connect to each port, and copy it
to/from your scalar signal:

signal vec_in, vec_out: std_logic_vector(0 downto 0);
signal scalar_in, scalar_out: std_logic;
...
instance : Pipeline_component
port map (input => vec_in, output => vec_out);

vec_in(0) <= scalar_in;
scalar_out <= vec_out(0);

Alternatively, and probably better, you can simply
connect up your scalar to one single numbered bit of the
port, thereby establishing the vector range for the port
as well as making the connection:

instance : Pipeline_component
port map (input(0) => scalar_in, output(0) => scalar_out);

Within the component, the unconstrained ports will now appear to
have vector range (0 to 0).

The usual caveats apply concerning unconstrained ports
and synthesis.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:[email protected]
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
Reply With Quote
Reply

Bookmarks


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 to represent "inout" data type in testbenches in "verilog" linuxczar Verilog 2 03-21-2007 06:28 PM
Why do we need "check" "call" "misc" in PLI? Lee Verilog 1 05-17-2004 03:42 PM
Warning: FlipFlops/Latches "/"ADR_reg<0>"/Q_reg" are set/reset by "". (FPGA-GSRMAP-14) Martin Bammer VHDL 0 11-17-2003 11:28 PM
"clean" or "unprotected" versions of AHDL2X, SYNTHX from Xilinx (ABL2XNF sub tools) Bill Smith FPGA 0 11-10-2003 11:17 PM


All times are GMT +1. The time now is 12:08 PM.


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