![]() |
|
|
|||||||
![]() |
VHDL - Calling custom defined hardware in a process |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2007
Posts: 1
|
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 |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |