EmbDev.net

Forum: FPGA, VHDL & Verilog Top module problems..


von John M. (215)


Rate this post
useful
not useful
I generated a fifo buffer using IP core, and are now having problem 
using it.

I made This is my top module
1
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
entity top is
4
    Port ( 
5
        Mclk:  in std_logic;
6
        LED : out  STD_LOGIC_VECTOR (5 downto 0);
7
        LEDf: out std_logic;
8
        LEDE: out std_logic;
9
           BTN : in  STD_LOGIC_VECTOR (3 downto 0);
10
           Switch : in  STD_LOGIC_VECTOR (7 downto 0));
11
end top;
12
architecture Behavioral of top is
13
14
Component FIFO IS
15
  PORT (
16
    clk : IN STD_LOGIC;
17
    rst : IN STD_LOGIC;
18
    din : IN STD_LOGIC_VECTOR(98 DOWNTO 0);
19
    wr_en : IN STD_LOGIC;
20
    rd_en : IN STD_LOGIC;
21
    dout : OUT STD_LOGIC_VECTOR(98 DOWNTO 0);
22
    full : OUT STD_LOGIC;
23
    empty : OUT STD_LOGIC
24
  );
25
END component;
26
begin
27
process(Mclk)
28
begin
29
if rising_edge(mclk) then 
30
  clk <= mclk;
31
  LEDf <= full; 
32
  LEDe <= empty; 
33
  wr_en<= BTN(0); 
34
  rd_en<= BTN(1);
35
  rst <= BTN(2); 
36
  din <= switch;
37
  dout <= LED;
38
end if;
39
end process;
40
end Behavioral;

why isn't this working, it isn't recognizing the input ports on my 
fifo.. these are the error messages.
1
Line 59. Undefined symbol 'clk'.
2
Line 60. Undefined symbol 'full'.  Should it be: null?
3
Line 60. full: Undefined symbol (last report in this block)
4
Line 61. Undefined symbol 'empty'.
5
Line 61. empty: Undefined symbol (last report in this block)
6
Line 62. Undefined symbol 'wr_en'.
7
Line 63. Undefined symbol 'rd_en'.
8
Line 64. Undefined symbol 'rst'.
9
Line 65. Undefined symbol 'din'.  Should it be: in or min?
10
Line 66. Undefined symbol 'dout'.  Should it be: out?

von Clem (Guest)


Rate this post
useful
not useful
It doesn't know any or your ports (not just your input).
You have to instantiate your FIFO.
Have a look at a easy port map example.
e.g. 
https://www.doulos.com/knowhow/vhdl_designers_guide/components_and_port_maps/

von John M. (215)


Rate this post
useful
not useful
I am not quite sure on how i should instantiate a component?
isn't what iam doing with component in my arcitecture?

-- EDIT--
1
entity top is
2
    Port ( 
3
        Mclk:  in std_logic;
4
        LED : out  STD_LOGIC_VECTOR (5 downto 0);
5
        LEDf: out std_logic;
6
        LEDE: out std_logic;
7
           BTN : in  STD_LOGIC_VECTOR (3 downto 0);
8
           Switch : in  STD_LOGIC_VECTOR (7 downto 0));
9
end top;
10
architecture Behavioral of top is
11
12
Component FIFO IS
13
  PORT (
14
    clk : IN STD_LOGIC;
15
    rst : IN STD_LOGIC;
16
    din : IN STD_LOGIC_VECTOR(98 DOWNTO 0);
17
    wr_en : IN STD_LOGIC;
18
    rd_en : IN STD_LOGIC;
19
    dout : OUT STD_LOGIC_VECTOR(98 DOWNTO 0);
20
    full : OUT STD_LOGIC;
21
    empty : OUT STD_LOGIC
22
  );
23
END component;
24
begin
25
26
G1: FIFO Port map (clk <= mclk , LEDf <= full, LEDe <= empty, wr_en<= BTN(0), rd_en<= BTN(1),rst <= BTN(2),din <= switch,dout <= LED); 
27
end Behavioral;

Errors:
1
Line 57. Undefined symbol 'clk'.
2
Line 57. clk: Undefined symbol (last report in this block)
3
Line 57. Undefined symbol 'full'.  Should it be: null?
4
Line 57. full: Undefined symbol (last report in this block)
5
Line 57. Undefined symbol 'empty'.
6
Line 57. empty: Undefined symbol (last report in this block)
7
Line 57. Undefined symbol 'wr_en'.
8
Line 57. wr_en: Undefined symbol (last report in this block)
9
Line 57. Undefined symbol 'rd_en'.
10
Line 57. rd_en: Undefined symbol (last report in this block)
11
Line 57. Undefined symbol 'rst'.
12
Line 57. rst: Undefined symbol (last report in this block)
13
Line 57. Undefined symbol 'din'.  Should it be: in or min?
14
Line 57. din: Undefined symbol (last report in this block)
15
Line 57. Undefined symbol 'dout'.  Should it be: out?
16
Line 57. dout: Undefined symbol (last report in this block)
17
Line 57. IN mode Formal clk of FIFO with no default value must be associated with an actual value.

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
How does this fifo look like? Is there a entity "fifo"?

von John M. (215)


Attached files:

Rate this post
useful
not useful
Not in my Top module, but i have a VHDL module called Fifo, which is 
generated by using the IP core

The FIFO vhd file is attached.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.