loki3118
Junior Member level 2
- Joined
- Jun 26, 2013
- Messages
- 23
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 238
Hello,
I'm a noob to VHDL and FPGA
I've written a simple code consisting of two counters that count down from 15. Both the clocks functioned as planned. Next wanted to implement DCM into the code in order to
phase shift the clock signals 90 degrees and run them both at 32MHz. I've run into some problems implementing the DCM code into my existing code. When I try to use the new output
clock signals I get some error and I'm not sure why. I tried to feed the output clocks directly into my counter code. This gave the following error: Parameter clk0/clk90 of mode in cannot be
associated with a formal port of mode out.
My questions are what does this error mean?
Is it possible to directly feed the two counting functions the output from the DCM if not what would be the best way to control the counters?
This code is just a starting place for a more complicated system that uses all four of the DCM outputs.
The code was written on ISE 14.5, eventually intended for spartan 3e.
I'm a noob to VHDL and FPGA
I've written a simple code consisting of two counters that count down from 15. Both the clocks functioned as planned. Next wanted to implement DCM into the code in order to
phase shift the clock signals 90 degrees and run them both at 32MHz. I've run into some problems implementing the DCM code into my existing code. When I try to use the new output
clock signals I get some error and I'm not sure why. I tried to feed the output clocks directly into my counter code. This gave the following error: Parameter clk0/clk90 of mode in cannot be
associated with a formal port of mode out.
My questions are what does this error mean?
Is it possible to directly feed the two counting functions the output from the DCM if not what would be the best way to control the counters?
This code is just a starting place for a more complicated system that uses all four of the DCM outputs.
The code was written on ISE 14.5, eventually intended for spartan 3e.
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
entity Counter2_DCM is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
clk0 : in STD_LOGIC;
clk90 : in STD_LOGIC;
DIRECTION0 : in STD_LOGIC;
DIRECTION90 : in STD_LOGIC;
COUNT_OUT0 : out STD_LOGIC_VECTOR (3 downto 0);
COUNT_OUT90 : out STD_LOGIC_VECTOR (3 downto 0));
end Counter2_DCM;
----------------------------------------------------------------------------------
architecture Behavioral of Counter2_DCM is
COMPONENT DCM1
PORT(
CLKIN_IN : IN std_logic;
RST_IN : IN std_logic;
CLKIN_IBUFG_OUT : OUT std_logic;
CLK0_OUT : OUT std_logic;
CLK2X_OUT : OUT std_logic;
CLK90_OUT : OUT std_logic;
LOCKED_OUT : OUT std_logic
);
END COMPONENT;
signal count_int0 : std_logic_vector(3 downto 0) := "0000";
signal count_int90 : std_logic_vector(3 downto 0) := "0000";
signal locked : std_logic;
----------------------------------------------------------------------------------
begin
Inst_DCM1: DCM1 PORT MAP(
CLKIN_IN => clk,
RST_IN => reset,
CLKIN_IBUFG_OUT => open,
CLK0_OUT => clk0,
CLK2X_OUT => open,
CLK90_OUT => clk90,
LOCKED_OUT => locked
);
----------------------------------------------------------------------------------
process (clk0)
--ERROR:HDLParsers:1411 - "E:/Taylor/FPGA/DMC_counter/Counter1_DCM.vhd" Line 48. Parameter clk0 of mode in can not be associated with a formal port of mode out.
begin
if clk0='1' and clk0'event then
if DIRECTION0='1' then
count_int0 <= count_int0 + 1;
else
count_int0 <= count_int0 - 1;
end if;
end if;
end process;
COUNT_OUT0 <= count_int0;
----------------------------------------------------------------------------------
process (clk90)
--ERROR:HDLParsers:1411 - "E:/Taylor/FPGA/DMC_counter/Counter1_DCM.vhd" Line 50. Parameter clk90 of mode in can not be associated with a formal port of mode out.
begin
if clk90='1' and clk90'event then
if DIRECTION90='1' then
count_int90 <= count_int90 + 1;
else
count_int90 <= count_int90 - 1;
end if;
end if;
end process;
COUNT_OUT90 <= count_int90;
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
end Behavioral;
Last edited: