Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > using FIFO in vhdl

Reply
Thread Tools

using FIFO in vhdl

 
 
sameer_ciit sameer_ciit is offline
Junior Member
Join Date: Aug 2009
Posts: 1
 
      08-17-2009
Hello,
I want to use FIFO component in vhdl. I have successfully designed FIFO component and it is working fine, i have tested it with testbench. But the problem is i don't know how to use this component in vhdl code.
Here is description of work i want to do. I have another component named ALU, one instantiation of it will write data into FIFO(PUSH) and other will read data from FIFO(POP). The code is
library ieee;
use ieee.std_logic_1164.all;

entity exam3 is
generic ( B: natural:=8; -- number of data bits
W: natural:=2 -- number of address bits
);
port(v10: in std_logic_vector(7 downto 0);
clk: in std_logic;
v40: out std_logic_vector(7 downto 0));
end exam3;

architecture structure of exam3 is

component alu is
port(a,b:in std_logic_vector(7 downto 0);
clk:in std_logic;
sel:in std_logic_vector(2 downto 0) ;
c: out std_logic_vector(7 downto 0));
end component;
component fifo
generic (B : natural;W:natural);
port ( clk: in std_logic;
rd, wr: in std_logic;
w_data: in std_logic_vector ( B-1 downto 0) ;
empty, full: out std_logic ;
r_data : out std_logic_vector ( B-1 downto 0));
end component;

signal rd,wr,s_empty,s_full: std_logic;
signal v4,v5: std_logic_vector(7 downto 0);
begin
u3: alu port map(v10, v5,clk,"101",v40); --xor

u_fifo:fifo
generic map(B=>B,W=>W)
port map(clk=>clk,rd=>rd,wr=>wr,
w_data=>v4,empty=>s_empty,full=>s_full,r_data=>v5) ;

u2: alu port map(v10, "11111111",clk,"001",v4); --and
end structure;

May be this is basic question but as i am new to VHDL, so i can't understand how to solve it. I will be thankful to you for your help.
 
Reply With Quote
 
 
 
 
debayan_p debayan_p is offline
Junior Member
Join Date: Jun 2009
Posts: 23
 
      08-24-2009
It is difficult to suggest something in this way. I do not have the overview of the whole design !
 
Reply With Quote
 
 
 
 
vipinlal vipinlal is offline
Member
Join Date: Feb 2010
Posts: 39
 
      03-10-2010
this may help you..
vhdlguru.blogspot.com/2010/03/basic-model-of-fifo-queue-in-vhdl.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FIFO, FIFO, It's Off To Queue We Go... Lawrence D'Oliveiro NZ Computing 7 05-09-2009 08:37 AM
any body having complete code for synchronous fifo or know a link where fifo codes are available plz help chaitu VHDL 1 06-01-2007 07:03 PM
any body having complete code for a synchronous FIFO or know a link where FIFO codes are available chaitu VHDL 1 06-01-2007 03:45 AM
any body having complete code for a synchronous FIFO or know a link where FIFO codes are available chaitu VHDL 1 05-31-2007 03:31 PM
any body having complete code for a synchronous FIFO or know a link where FIFO codes are available chaitu VHDL 0 05-31-2007 02:28 PM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57