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

Reply

VHDL - Calling custom defined hardware in a process

 
Thread Tools Search this Thread
Old 09-13-2007, 02:20 PM   #1
Default Calling custom defined hardware in a process


Hi,

I am a fairly novice into VHDL. I have written the code of a barrel
shifter and now i wish to use the barrel shifter in a larger
application.

However VHDL does not allow an entity to be created during a process.
I want to use the barrel shifter to shift a bit in Booth's
multiplication algorithm. How can i do it? I am using Xilinx ISE 9.2i
to generate the circuit.

Also i have the book by Zwolinski for introduction to VHDl. Can some
please suggest a fairly more advanced text about synthesizable VHDL.

Thanks a lot

Joseph



joseph
  Reply With Quote
Old 09-13-2007, 03:47 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: Calling custom defined hardware in a process
joseph wrote:

> However VHDL does not allow an entity to be created during a process.


True, but it is easy to wrap an architecture around
a process and add an entity to the top.
A related example:
http://home.comcast.net/~mike_treseler/barrel.vhd

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 09-13-2007, 04:02 PM   #3
Guffi
 
Posts: n/a
Default Re: Calling custom defined hardware in a process
joseph pisze:
> Hi,
>
> I am a fairly novice into VHDL. I have written the code of a barrel
> shifter and now i wish to use the barrel shifter in a larger
> application.
>
> However VHDL does not allow an entity to be created during a process.
> I want to use the barrel shifter to shift a bit in Booth's
> multiplication algorithm. How can i do it? I am using Xilinx ISE 9.2i
> to generate the circuit.
>
> Also i have the book by Zwolinski for introduction to VHDl. Can some
> please suggest a fairly more advanced text about synthesizable VHDL.
>
> Thanks a lot
>
> Joseph
>

I don't know if I understood you correctly, because my english isn't so
good but try:


You have to have e.g 2 files. In the first one you have your shifter and
in the second one as follows:


library IEEE;
use IEEE.STD_LOGIC_1164.all;

entity Booth is
port(
-- here your ports
);
end Booth;


architecture Booth of Booth is

-- declaration of components:
component shifter
port(
--here your ports copied from Shifter's entity
);
end component;
-- declaation of signals, e.g.
signal In1, Out1 : std_logic_vector (n-1 downto 0); -- this vectors'

-- length should be exacly the same as your in/out ports of shifter

begin

-- here you put your shifter e.g. in this way:

My_shifter: shifter port map (In1,IN2); -- <= this is only example, you
have to map here your shifter ports with some signals... which have been
declared above



process (.....)
-- your process
end process;
end Booth;

It should looks similar to what I have written.
And read more about comoponent instatiation
It would help you




Guffi
  Reply With Quote
Old 09-19-2007, 06:45 PM   #4
Mike Treseler
 
Posts: n/a
Default Re: Calling custom defined hardware in a process
Mike Treseler wrote:

>> However VHDL does not allow an entity to be created during a process.


Besides an instance,
another way to reuse the barrel shifter code
in another process is to extract and merge the
init, update and output procedures from the
working entity into the target process.

I could merge "copy and paste" using a text editor
or I could add parameters and package the subprograms
that I use frequently.


-- Mike Treseler
____________
procedure update_regs is -- distilled functional description
begin
if strobe='1' then
reg_v := d;
reg_v := shift_left(reg_v,to_integer(n));
end if;
end procedure update_regs;


Mike Treseler
  Reply With Quote
Old 09-19-2007, 11:20 PM   #5
avimit
Junior Member
 
Join Date: Sep 2007
Posts: 1
Default create a function and call it inside the process
You can create a function for barrel shifter, and call that function inside a process.
An example of writing a function, and calling it can be found here:
http://www.vlsiip.com/dc_shell/counter.vhd
This file includes a function called 'incr_vec' and then calls this function inside a process.
Hope it helps,
Kr,
Avi
http://www.vlsiip.com


avimit
avimit is offline   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
Asynchronous process from asp.net page button click event? Ritha Software 0 09-29-2009 03:20 PM
Juniper hardware license ipmiracle Hardware 0 01-23-2008 03:08 PM
A+ Exam Revision Update Process Starting John P. Dearing A+ Certification 6 02-10-2006 01:44 AM
High Definition and the future of viewing. Allan DVD Video 3 03-09-2005 12:56 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