Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Port "data0" does not exist in primitive "and2" of instance "U1"

Dear my best friends

I'm coding an entity JKFF_TFF and I use MegaWirard function to generate code for and2. After that I copy VHDL code of and2 to the same vhdl file of my entity.

When I compile it have a problem with this notice:

--- Quote Start ---

Error: Port "data0" does not exist in primitive "and2" of instance "U1"

Error: Port "data1" does not exist in primitive "and2" of instance "U1"

Error: Port "result" does not exist in primitive "and2" of instance "U1"

--- Quote End ---

and this is my code:


library IEEE;
use work.all;
USE ieee.std_logic_1164.all;
LIBRARY lpm;
USE lpm.lpm_components.all;
entity JKFF_TFF is
port 	(x,xp	: In STD_LOGIC;
		Z		: Out STD_LOGIC;
		clk		: In STD_LOGIC);
end JKFF_TFF;
architecture structure of JKFF_TFF is
Signal 	a1,a2				:  STD_LOGIC;
Signal	o1,o2,o3,o4			:  STD_LOGIC;
Signal	Y0,Y1,Y2,Y3,Y4		:  STD_LOGIC;
Signal	Q0,Q0p,Q1,Q1p,Q2,Q2p:  STD_LOGIC;
Begin
U1: Entity and2 port map (x,Q1p,a1);
End structure;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY lpm;
USE lpm.lpm_components.all;
ENTITY and2 IS
	PORT
	(
		data0		: IN STD_LOGIC ;
		data1		: IN STD_LOGIC ;
		result		: OUT STD_LOGIC 
	);
END and2;
ARCHITECTURE SYN OF and2 IS
--	type STD_LOGIC_2D is array (NATURAL RANGE <>, NATURAL RANGE <>) of STD_LOGIC;
	SIGNAL sub_wire0	: STD_LOGIC_VECTOR (0 DOWNTO 0);
	SIGNAL sub_wire1	: STD_LOGIC ;
	SIGNAL sub_wire2	: STD_LOGIC ;
	SIGNAL sub_wire3	: STD_LOGIC_2D (1 DOWNTO 0, 0 DOWNTO 0);
	SIGNAL sub_wire4	: STD_LOGIC ;
BEGIN
	sub_wire4    <= data0;
	sub_wire1    <= sub_wire0(0);
	result    <= sub_wire1;
	sub_wire2    <= data1;
	sub_wire3(1, 0)    <= sub_wire2;
	sub_wire3(0, 0)    <= sub_wire4;
	lpm_and_component : lpm_and
	GENERIC MAP (
		lpm_size => 2,
		lpm_type => "LPM_AND",
		lpm_width => 1
	)
	PORT MAP (
		data => sub_wire3,
		result => sub_wire0
	);
END SYN;

I don't know how to solve this problem. Could you help me? Thanks

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thank you.

    I had found the document to introduce this step by step:

    This is my link: http://www.mediafire.com/?iv6v06zs288bdgd

    From page 11 to page 18. But i don't know how to make a state table - High level description (at page 13). Because the original circuit have 5 state from Y0 to Y4 and new circuit have only 3.

    Could you help me?

    --- Quote End ---

    You don't need a complicated state machine approach. All you need - given DFF, how do convert to JK or T.

    Converting JK or T to D is easy but the reverse is a bit more involved.

    I found this circuit for converting D to JK (check if it is correct):

    add two AND plus one Or at front of DFF. The Ored output connects to D.

    (J)---------------and1_input1

    (Q')--------------and1_input2

    Q'---invert-------and2_input1

    K----invert-------and2_input2

    To convert D to T, convert JK to T by wiring the above JK together.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you so much. You are very kind. I try it now. If I meet error, i hope you will help me again.