Forum: FPGA, VHDL & Co. Spartan3 DCM geht nicht


von rujatt (Gast)


Lesenswert?

Hallo, habe ein Spartan 3S200FT256 Board von Xilinx.
Das wird wahrscheinlich niemand glauben, aber ich versuche seid
stunden den DCM in mein Source zu integrieren mit clk2x
Das klappt einfach nicht mehr. Immer irgentwelche Fehlermeldungen.
Kann mir jemannd ein leeres Projekt File geben in das ich dann
einfach meinen Quellcode reinsetze - denke das muss in jedem Fall gehe.
Nutze ISE 7i - ist halt alles ein Original Bundle.

: Gesperrt durch Moderator
von DCM Gast (Gast)


Lesenswert?

Hallo,

>Das wird wahrscheinlich niemand glauben, aber ich versuche seid
>stunden den DCM in mein Source zu integrieren mit clk2x
>Das klappt einfach nicht mehr. Immer irgentwelche Fehlermeldungen.

hier im Forum sind viele Gläubige, die glauben auch sowas.

Stell doch einfach mal deine DCM Komponente als Quellcode
hier rein. Dann kann man mal drüberschauen und andere lernen
vieleicht auch noch was dabei.

Bye

von rujatt (Gast)


Lesenswert?

Also als Fehlermeldung hab ich:
---------------------------------------

HDLParsers:3312 - "C:/timer.vhd" Line 53. Undefined symbol 'clk2x'.
ERROR:HDLParsers:1209 - "C:/timer.vhd" Line 53. clk2x: Undefined symbol 
(last report in this block)
ERROR:HDLParsers:808 - "C:/timer.vhd" Line 55. = can not have such 
operands in this context.
WARNING:HDLParsers:1406 - "C:/timer.vhd" Line 53. No sensitivity list 
and no wait in the process




bei diesem Source :
-----------------------



library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
---  >>>>>  t_clk    clock in for counting
---  >>>>>  t_reset    reset counter to 0
---  <<<<<  t_sec    8Bit output hold the second count result
---  <<<<<
---------------------------------------------------------------------

ENTITY timer IS
  Port (clkin : IN std_logic;
      t_reset : in std_logic;
      t_sec :  out std_logic_vector(7 downto 0)
      );
END timer;


ARCHITECTURE timer_logic OF timer IS

signal sec_counter: std_logic_vector(7 downto 0);
signal counter: std_logic_vector(25 downto 0);
begin

process(clk2x)
begin
if (clk2x='1' and clk2x'event) then
counter <= counter + "1";
t_sec <= sec_counter;

 if (counter>"10111110101111000010000000") then
counter <=   "00000000000000000000000000";
sec_counter <= sec_counter +'1';
end if;

if (t_reset='1') then
 counter <= "00000000000000000000000000";
sec_counter <= "00000000";
t_sec <= "11000000";
end if;

end if; --clock event
end process;

end timer_logic;





Das ist der Source vom DCM-Wizzard:
-------------------------------------------------



library ieee;
use ieee.std_logic_1164.ALL;
use ieee.numeric_std.ALL;
-- synopsys translate_off
library UNISIM;
use UNISIM.Vcomponents.ALL;
-- synopsys translate_on

entity te is
   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;
          LOCKED_OUT      : out   std_logic);
end te;

architecture BEHAVIORAL of te is
   signal CLKFB_IN        : std_logic;
   signal CLKIN_IBUFG     : std_logic;
   signal CLK0_BUF        : std_logic;
   signal CLK2X_BUF       : std_logic;
   signal GND             : std_logic;
   component IBUFG
      port ( I : in    std_logic;
             O : out   std_logic);
   end component;

   component BUFG
      port ( I : in    std_logic;
             O : out   std_logic);
   end component;

   component DCM
      generic( CLK_FEEDBACK : string :=  "1X";
               CLKDV_DIVIDE : real :=  2.000000;
               CLKFX_DIVIDE : integer :=  1;
               CLKFX_MULTIPLY : integer :=  4;
               CLKIN_DIVIDE_BY_2 : boolean :=  FALSE;
               CLKIN_PERIOD : real :=  0.000000;
               CLKOUT_PHASE_SHIFT : string :=  "NONE";
               DESKEW_ADJUST : string :=  "SYSTEM_SYNCHRONOUS";
               DFS_FREQUENCY_MODE : string :=  "LOW";
               DLL_FREQUENCY_MODE : string :=  "LOW";
               DUTY_CYCLE_CORRECTION : boolean :=  TRUE;
               FACTORY_JF : bit_vector :=  x"C080";
               PHASE_SHIFT : integer :=  0;
               STARTUP_WAIT : boolean :=  FALSE;
               DSS_MODE : string :=  "NONE");
      port ( CLKIN    : in    std_logic;
             CLKFB    : in    std_logic;
             RST      : in    std_logic;
             PSEN     : in    std_logic;
             PSINCDEC : in    std_logic;
             PSCLK    : in    std_logic;
             DSSEN    : in    std_logic;
             CLK0     : out   std_logic;
             CLK90    : out   std_logic;
             CLK180   : out   std_logic;
             CLK270   : out   std_logic;
             CLKDV    : out   std_logic;
             CLK2X    : out   std_logic;
             CLK2X180 : out   std_logic;
             CLKFX    : out   std_logic;
             CLKFX180 : out   std_logic;
             STATUS   : out   std_logic_vector (7 downto 0);
             LOCKED   : out   std_logic;
             PSDONE   : out   std_logic);
   end component;

begin
   GND <= '0';
   CLKIN_IBUFG_OUT <= CLKIN_IBUFG;
   CLK0_OUT <= CLKFB_IN;
   CLKIN_IBUFG_INST : IBUFG
      port map (I=>CLKIN_IN,
                O=>CLKIN_IBUFG);

   CLK0_BUFG_INST : BUFG
      port map (I=>CLK0_BUF,
                O=>CLKFB_IN);

   CLK2X_BUFG_INST : BUFG
      port map (I=>CLK2X_BUF,
                O=>CLK2X_OUT);

   DCM_INST : DCM
   generic map( CLK_FEEDBACK => "1X",
            CLKDV_DIVIDE => 2.000000,
            CLKFX_DIVIDE => 1,
            CLKFX_MULTIPLY => 4,
            CLKIN_DIVIDE_BY_2 => FALSE,
            CLKIN_PERIOD => 20.000000,
            CLKOUT_PHASE_SHIFT => "NONE",
            DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS",
            DFS_FREQUENCY_MODE => "LOW",
            DLL_FREQUENCY_MODE => "LOW",
            DUTY_CYCLE_CORRECTION => TRUE,
            FACTORY_JF => x"C080",
            PHASE_SHIFT => 0,
            STARTUP_WAIT => FALSE)
      port map (CLKFB=>CLKFB_IN,
                CLKIN=>CLKIN_IBUFG,
                DSSEN=>GND,
                PSCLK=>GND,
                PSEN=>GND,
                PSINCDEC=>GND,
                RST=>RST_IN,
                CLKDV=>open,
                CLKFX=>open,
                CLKFX180=>open,
                CLK0=>CLK0_BUF,
                CLK2X=>CLK2X_BUF,
                CLK2X180=>open,
                CLK90=>open,
                CLK180=>open,
                CLK270=>open,
                LOCKED=>LOCKED_OUT,
                PSDONE=>open,
                STATUS=>open);

end BEHAVIORAL;





und dann habe ich noch das DCM Template:
--------------------------------------------------------


-- VHDL Instantiation Created from source file te.vhd -- 13:34:41 
11/07/2010
--
-- Notes:
-- 1) This instantiation template has been automatically generated using 
types
-- std_logic and std_logic_vector for the ports of the instantiated 
module
-- 2) To use this template to instantiate this entity, cut-and-paste and 
then edit

  COMPONENT te
  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;
    LOCKED_OUT : OUT std_logic
    );
  END COMPONENT;

  Inst_te: te PORT MAP(
    CLKIN_IN => ,
    RST_IN => ,
    CLKIN_IBUFG_OUT => ,
    CLK0_OUT => ,
    CLK2X_OUT => ,
    LOCKED_OUT =>
  );

----------------------------------------------------------------

von DCM Gast (Gast)


Lesenswert?

Du hast dir zwar per DCM Wizzard die DCM-Komponente generiert,
musst sie aber noch in deine timer-Komponente einbinden
(Definition und Instantiierung fehlen). Ausserdem fehlt noch das
Signal clk2x.

Btw. verwende für counter und sec_counter statt "std_logic_vector"
besser  "integer range..", ist lesbarer. Und dann vieleicht noch
die Zuweisung "t_sec <= sec_counter;" aus dem Prozess raus.


Gruss

von rujatt (Gast)


Lesenswert?

Mir ist nicht ganz klar was ich einbinden muss und wie ich die
Instantierung genau mache.
Es geht offensichtlich um dieses hier- richtig ? :
-------------------------------------
  COMPONENT te
  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;
    LOCKED_OUT : OUT std_logic
    );
  END COMPONENT;

  Inst_te: te PORT MAP(
    CLKIN_IN => ,
    RST_IN => ,
    CLKIN_IBUFG_OUT => ,
    CLK0_OUT => ,
    CLK2X_OUT => ,
    LOCKED_OUT =>
  );
--------------------------------

Aber wie wird dies in meinem timer Beispiel instantiert ?
Habe soetwas noch nie gemacht.

Und wie bindet man die Definitionen ein ?

von Lothar M. (Firma: Titel) (lkmiller) (Moderator) Benutzerseite


Lesenswert?

rujatt schrieb:
> Und wie bindet man die Definitionen ein ?
Mach dich mal zum Thema "Komponenten" schlau.
Und dann mußt du nur die Komponente te in deinen Code einbinden.
Etwa so:
1
ENTITY timer IS
2
  Port (clkin : IN std_logic;
3
      t_reset : in std_logic;
4
      t_sec :  out std_logic_vector(7 downto 0)
5
      );
6
END timer;
7
8
9
ARCHITECTURE timer_logic OF timer IS
10
11
  COMPONENT te
12
  PORT(
13
    CLKIN_IN : IN std_logic;
14
    RST_IN : IN std_logic;
15
    CLKIN_IBUFG_OUT : OUT std_logic;
16
    CLK0_OUT : OUT std_logic;
17
    CLK2X_OUT : OUT std_logic;
18
    LOCKED_OUT : OUT std_logic
19
    );
20
  END COMPONENT;
21
22
signal sec_counter: std_logic_vector(7 downto 0);
23
signal counter: std_logic_vector(25 downto 0);
24
25
signal clk2x: std_logic;  --- das Fehlen dieses Signals wurde bemängelt...
26
27
begin
28
29
  Inst_te: te PORT MAP(
30
    CLKIN_IN => clkin ,
31
    RST_IN => t_reset,
32
    CLKIN_IBUFG_OUT => null,
33
    CLK0_OUT => null,
34
    CLK2X_OUT => clk2x,
35
    LOCKED_OUT => null
36
  );
37
38
39
40
process(clk2x)
41
begin
42
 if (clk2x='1' and clk2x'event) then
43
  counter <= counter + "1";
44
  t_sec <= sec_counter;
45
46
  if (counter>"10111110101111000010000000") then
47
     counter <=   "00000000000000000000000000";
48
     sec_counter <= sec_counter +'1';
49
   end if;
50
51
  if (t_reset='1') then
52
    counter <= "00000000000000000000000000";
53
    sec_counter <= "00000000";
54
    t_sec <= "11000000";
55
  end if;
56
57
 end if; --clock event
58
end process;
59
60
end timer_logic;

BTW:
>  if (counter>"10111110101111000010000000") then
>     counter <=   "00000000000000000000000000";
Nimm als Zähler doch besser einen integer, dann muß man nicht solche 
zwielichtigen Bitmuster enwirren...   :-/
So wie dort z.B. 
http://www.lothar-miller.de/s9y/archives/61-Lauflicht.html
(Da kannst du übrigens auch die Component-Geschichte nochmal sehen)

von rujatt (Gast)


Lesenswert?

Aha, habe die Componente te so eingefügt.
Inst_te : te   instantiwert dann die Port-Map nehme ich an.
Das ich meine net-Constrains hier noch eintragen muste wuste ich nicht.
Jetzt bekomme ich immer noch den Fehler das er clk2x nicht kennt.

------------------------------------------------------
HDLParsers:3312 - "C:/timer.vhd" Line 73. Undefined symbol 'clk2x'.
ERROR:HDLParsers:1209 - "C:/timer.vhd" Line 73. clk2x: Undefined symbol 
(last report in this block)
ERROR:HDLParsers:3294 - "C:/timer.vhd" Line 71. Can not determine a type 
for Null value.
ERROR:HDLParsers:3294 - "C:/timer.vhd" Line 72. Can not determine a type 
for Null value.
ERROR:HDLParsers:3294 - "C:/timer.vhd" Line 74. Can not determine a type 
for Null value.
ERROR:HDLParsers:808 - "C:/timer.vhd" Line 80. = can not have such 
operands in this context.
WARNING:HDLParsers:1406 - "C:/timer.vhd" Line 77. No sensitivity list 
and no wait in the process
----------------------------------------
Warum kennt er clk2x noch nicht ?

Die Linkseite ist interessant werde ich mir bei gegelenheit genauer 
anschauen.

von Lothar M. (Firma: Titel) (lkmiller) (Moderator) Benutzerseite


Lesenswert?

> Das ich meine net-Constrains hier noch eintragen muste wuste ich nicht.
Du verwechselt hier Kraut&Rüben...

> Jetzt bekomme ich immer noch den Fehler das er clk2x nicht kennt.
Der Fehler liegt eher in Zeile 42...  :-/
Oder: woher soll ich denn deinen Code kennen?
Poste mal deine timer.vhd Datei als Anhang (mit Endung .vhd wegen des 
Syntax-Highlightings)...

von rujatt (Gast)


Angehängte Dateien:

Lesenswert?

Ich habe an der timer.vhd nichts geändert ausser die
Componente und Instantierung eingetragen.

Datei im Anhang.
Bin gespannt was ich falsch mache.

von Lothar M. (Firma: Titel) (lkmiller) (Moderator) Benutzerseite


Lesenswert?

rujatt schrieb:
> Angehängte Dateien:
>         timer.vhd.txt
.txt ?
Hast du nicht gelesen, was ich geschrieben hatte?
Lothar Miller schrieb:
> Poste mal deine timer.vhd Datei als Anhang (mit Endung .vhd wegen des
> Syntax-Highlightings)...

Seis drum...
Nehmen wir mal deinen Code:
1
signal sec_counter: std_logic_vector(7 downto 0);
2
signal counter: std_logic_vector(25 downto 0);
3
4
5
begin
6
       
7
Inst_te: te PORT MAP(
8
    CLKIN_IN => clkin ,
9
    RST_IN => t_reset,
10
    CLKIN_IBUFG_OUT => null,
11
    CLK0_OUT => null,
12
    CLK2X_OUT => clk2x,
13
    LOCKED_OUT => null
14
  );
Hast du nicht gelesen, was ich geschrieben hatte?

Lothar Miller schrieb:
1
signal sec_counter: std_logic_vector(7 downto 0);
2
signal counter: std_logic_vector(25 downto 0);
3
4
signal clk2x: std_logic;  --- das Fehlen dieses Signals wurde bemängelt...
5
6
begin
7
8
  Inst_te: te PORT MAP(
9
    CLKIN_IN => clkin ,
10
    RST_IN => t_reset,
11
    CLKIN_IBUFG_OUT => null,
12
    CLK0_OUT => null,
13
    CLK2X_OUT => clk2x,
14
    LOCKED_OUT => null
15
  );
Such mal den Unterschied...

EDIT: schreib statt null doch besser open :
1
  Inst_te: te PORT MAP(
2
    CLKIN_IN => clkin ,
3
    RST_IN => t_reset,
4
    CLKIN_IBUFG_OUT => open,
5
    CLK0_OUT => open,
6
    CLK2X_OUT => clk2x,
7
    LOCKED_OUT => open
8
  );

von rujatt (Gast)


Lesenswert?

OK besten Dank, ich sitze schon so lange daran das ich selbst einfache
Dinge übersehe.
Es kommen keine Errors mehr aber ein kleines Problem ist noch da.
Irgentwie hängt der DCM d.h. das Demoprogramm hängt.
Zuerst dachte ich der Takt ist zu hoch.
Das gleiche ist aber auch der Fall wenn ich clk0 oder clkin mit 50mhz 
nutze.
Das System hängt iregentwie ?
Woran liegt das ?

von rujatt (Gast)


Lesenswert?

OK hab den Fehler - funktioniert bestens.
Danke nochmal, ohne die Hilfe hätte ich es nicht hin gekriegt.

von Frank (Gast)


Lesenswert?

Wir brauchen dringend ein Anfängerforum.

von Lothar M. (Firma: Titel) (lkmiller) (Moderator) Benutzerseite


Lesenswert?

Frank schrieb:
> Wir brauchen dringend ein Anfängerforum.
Nein, wir bräuchten eher dringend Anfänger, die nicht bei jedem kleinen 
Problem die Publikumsfrage stellen...  :-/

von Ramon F. (tronixx)


Lesenswert?

Hallo zusammen,

ich hänge an einem ähnlochen problem um mein DCM einzubinden.
Hab mir mit dem IP core ein DCM nach wünschen erzeugt

50 MHz rein  ->   50 und 18 Mhz raus.

die HDL Instantiation Template hab ich dann wie folgt in ein neues VHDL 
Modul eingebunden und daraus ein Schematic Symbol erstellt und mit in 
meine top level Schematic eingebunden. Simulation klappt auch 
einwandfrei soweit. Nur bei der Synthese meckert er folgendes:
Was mach ich denn hier falsch. Suche im Netz hat mich nicht gerade 
weitergebracht

------------------------------------------------------------------------ 
-
ERROR:Xst:2585 - Port <CLK0> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLK180> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLK270> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLK2X> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLK2X180> of instance <DCM_INST> does not exist 
in definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLK90> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLKDV> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLKFB> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLKFX> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLKFX180> of instance <DCM_INST> does not exist 
in definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <CLKIN> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <DSSEN> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <LOCKED> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <PSCLK> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <PSDONE> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <PSEN> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <PSINCDEC> of instance <DCM_INST> does not exist 
in definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <RST> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
ERROR:Xst:2585 - Port <STATUS> of instance <DCM_INST> does not exist in 
definition <DCM>. Please compare the definition of block <DCM> to its 
component declaration to detect the mismatch.
------------------------------------------------------------------------ 
-
1
library ieee;
2
use ieee.std_logic_1164.ALL;
3
use ieee.numeric_std.ALL;
4
5
library UNISIM;
6
use UNISIM.Vcomponents.ALL;
7
8
9
10
entity DCM_x is
11
    Port ( clk_50 : in  STD_LOGIC;
12
           clk18 : out  STD_LOGIC;
13
        Reset         : in    std_logic; 
14
        CLK0        : out   std_logic); 
15
16
end DCM_x;
17
18
architecture Behavioral of DCM_x is
19
20
COMPONENT DCM_test
21
  PORT(
22
    CLKIN_IN : IN std_logic;
23
    RST_IN : IN std_logic;          
24
    CLKFX_OUT : OUT std_logic;
25
    CLKIN_IBUFG_OUT : OUT std_logic;
26
    CLK0_OUT : OUT std_logic;
27
    LOCKED_OUT : OUT std_logic
28
    );
29
  END COMPONENT;
30
  
31
begin
32
33
Inst_DCM_test: DCM_test PORT MAP(
34
    CLKIN_IN => clk_50,
35
    RST_IN => Reset,
36
    CLKFX_OUT => clk18,
37
    CLKIN_IBUFG_OUT => open ,
38
    CLK0_OUT => CLK0 ,
39
    LOCKED_OUT => open 
40
  );
41
42
43
end Behavioral;

von Lothar M. (Firma: Titel) (lkmiller) (Moderator) Benutzerseite


Lesenswert?

Ramon F. schrieb:
> Was mach ich denn hier falsch.
Du gibst die Zielarchitektur und die ISE-Version nicht an!

> ich hänge an einem ähnlochen problem um mein DCM einzubinden.
Bitte fange einen neuen Thread an und verweise von dort hierher, wenn es 
relevant ist.

Jetzt muss jeder den 3 Jahre alten Schriftverkehr durchlesen, um dann 
herauszufinden, dass es ein neues, unabhängiges Problem gibt...

Dieser Beitrag ist gesperrt und kann nicht beantwortet werden.