EmbDev.net

Forum: FPGA, VHDL & Verilog Port Map Errors


von Jay J. (jboss10)


Rate this post
useful
not useful
I have quite a large project involving a Traffic Light system. I'm at 
the point of port mapping all of my blocks together within the top 
entity as I will post..
1
library IEEE; 
2
use ieee.std_LOGIC_1164.all; 
3
4
5
entity Final_TLSystem is 
6
7
port
8
   (V_Sensor          :  in  std_logic;
9
    mclk         :  in  std_logic; 
10
    mst_reset       :  in  std_logic; 
11
    Traffic_Lights   :  out std_logic_vector ( 5 downto 0)
12
    
13
    ); 
14
    
15
end Final_TLSystem; 
16
  
17
  architecture Final_TLSystem_arch of Final_TLSystem is 
18
  signal internal     : std_logic_vector (1 downto 0);
19
  signal tempTrig : std_logic_vector (1 downto 0);
20
  signal tempclk   : std_logic; 
21
  signal tempTime : std_logic_vector (1 downto 0);
22
  
23
  
24
 
25
  
26
  component SeqLogic is
27
  port     (clk_in  : in  std_logic;
28
         reset   : in  std_logic; 
29
         TS      : in  STD_logic;
30
         TL      : in  std_logic; 
31
         V       : in  std_logic; 
32
         S        : out std_logic_vector (1 downto 0)
33
         
34
         );
35
         
36
  end component; 
37
  
38
component TLightSystem is 
39
40
  port  (State_In : in  std_logic_vector  (1 downto 0);   
41
        Lights   : out std_logic_vector (5 downto 0);
42
       TS_TL   : out std_logic_vector (1 downto 0)
43
       );
44
      
45
           
46
47
end component;
48
49
--component FreqDivider is
50
  --  port(
51
    --     clk_24MHz : in STD_LOGIC;
52
     --    clk_24KHz : out STD_LOGIC
53
     --    );
54
--end component;
55
56
component pulse_counter is
57
58
port     ( clk_24Khz     : in  std_logic; 
59
        trigger_long  : in  std_logic; 
60
        trigger_short : in  std_logic; 
61
        TS         : out std_logic; 
62
        TL         : out std_logic 
63
       );
64
      
65
end component; 
66
67
begin 
68
69
  U1 : SeqLogic      port map (V=> V_sensor, internal(0)=>S(0), internal(1)=>S(1),tempTrig(0) => TS, tempTrig(1)=>TL, tempclk=>clk_in, reset=> mst_reset); 
70
  U2 : TLightSystem  port map (Lights=>Traffic_Lights, tempTrig(0)=> TS_TL(0), tempTrig1=> TS_TL(1), tempS0=> State_In(0), tempS1 => State_In(1)); 
71
  U3 : pulse_counter port map (tempclk=>clk_24KHz, tempTime(0)=> TS, tempTime(1)=>TL, tempTrig(0)=> trigger_long, tempTrig(1)=>trigger_short, clk_24KHz=>mclk);  
72
73
74
end Final_TLSystem_arch;

Errors I'm receiving:
"type of formal parameter "internal" does not match type or value"
"object "S" is used but not declared"
"cannot associate formal port "internal" of mode "object" with an 
expression"

..same errors trickle down with tempTrig, clk_in, TS, TL, tempClk, and 
reset. I'm clearly not connected this right.

Thanks for any input. Let me know if any other information is needed.

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


Rate this post
useful
not useful
Ouch! There are multiple basic bugs in this description.

First:
A port map is "port_signal => external_signal" from the view of the 
component.
Your tempclk is the external signal:
> signal tempclk   : std_logic;
and your clk_24khz is the port signal:
> component pulse_counter is
> port ( clk_24Khz  : in  std_logic;
So this assignment here (and as far as I see most of the others also) is 
the wrong direction:
> U3 : pulse_counter port map (tempclk=>clk_24KHz, ...

Second:
> U1 : SeqLogic      port map (V=> V_sensor,
You MUST(!!) pass eyery asynchronous external signal through at least 
one better are two synchronisation flipflops before you use it inside 
your design. See this here:
http://www.lothar-miller.de/s9y/archives/64-State-Machine-mit-asynchronem-Eingang.html


Third:
> mclk, tempclk, clk_24khz ...
Far way much too much clocks in this beginners design!!
A beginners design must have exactly 1 clock. All the rest is done by 
clock enables. See there the very last code snippet:
http://www.lothar-miller.de/s9y/archives/80-Hello-World!.html
The whole design has only clk as clock. 't' is the clock enable.

von asd (Guest)


Rate this post
useful
not useful
1
  U1 : SeqLogic      port map (V=> V_sensor, internal(0)=>S(0), internal(1)=>S(1),tempTrig(0) => TS, tempTrig(1)=>TL, tempclk=>clk_in, reset=> mst_reset); 
2
  U2 : TLightSystem  port map (Lights=>Traffic_Lights, tempTrig(0)=> TS_TL(0), tempTrig1=> TS_TL(1), tempS0=> State_In(0), tempS1 => State_In(1)); 
3
  U3 : pulse_counter port map (tempclk=>clk_24KHz, tempTime(0)=> TS, tempTime(1)=>TL, tempTrig(0)=> trigger_long, tempTrig(1)=>trigger_short, clk_24KHz=>mclk);

wrong order of port map assignments. Should be S(0)=>internal(0) for 
example...
Would also be much more readable with some line feeds:
1
U1 : SeqLogic
2
  port map (
3
   V      => V_sensor,
4
   S      => internal,
5
   TS     => tempTrig(0),
6
   TL     => tempTrig(1),
7
   clk_in => tempclk,
8
   reset  => mst_reset);
something in that style...

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.