]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
placing test point
authorMichael Boehmer <mboehmer@ph.tum.de>
Mon, 25 Apr 2022 21:00:28 +0000 (23:00 +0200)
committerMichael Boehmer <mboehmer@ph.tum.de>
Mon, 25 Apr 2022 21:00:28 +0000 (23:00 +0200)
special/clockbox.vhd [new file with mode: 0644]
special/ddmtd.vhd

diff --git a/special/clockbox.vhd b/special/clockbox.vhd
new file mode 100644 (file)
index 0000000..6c6f4d1
--- /dev/null
@@ -0,0 +1,61 @@
+library ieee;\r
+use ieee.std_logic_1164.all;\r
+use ieee.numeric_std.all;\r
+\r
+library work;\r
+\r
+entity clockbox is\r
+  port(\r
+    SAMPLE_CLK    : in  std_logic;\r
+    PING_IN       : in  std_logic; -- TX K\r
+    CLK_PING      : in  std_logic; -- TX CLK\r
+    PONG_IN       : in  std_logic; -- RX K\r
+    CLK_PONG      : in  std_logic; -- RX CLK\r
+    PING_OUT      : out std_logic;\r
+    PONG_OUT      : out std_logic\r
+  );\r
+end entity clockbox;\r
+\r
+architecture clockbox_arch of clockbox is\r
+\r
+-- Components\r
+\r
+-- state machine signals\r
+\r
+-- Signals\r
+  signal ping_i         : std_logic;\r
+  signal pong_i         : std_logic;\r
+  signal ping_q         : std_logic;\r
+  signal pong_q         : std_logic;\r
+  signal ping_qq        : std_logic;\r
+  signal pong_qq        : std_logic;\r
+\r
+  attribute HGROUP : string;\r
+  attribute BBOX   : string;\r
+  attribute HGROUP of clockbox_arch : architecture is "clockbox_group";\r
+  attribute BBOX   of clockbox_arch : architecture is "1,2";\r
+  attribute syn_sharing : string;\r
+  attribute syn_sharing of clockbox_arch : architecture is "off";\r
+  attribute syn_hier : string;\r
+  attribute syn_hier of clockbox_arch : architecture is "hard";\r
+  \r
+begin\r
+\r
+---------------------------------------------------------------------------\r
+-- we want all logic in here in one PFU (defined timing)!\r
+---------------------------------------------------------------------------\r
+\r
+  ping_i  <= PING_IN when rising_edge(CLK_PING);\r
+  pong_i  <= PONG_IN when rising_edge(CLK_PONG);\r
+  ping_q  <= ping_i when rising_edge(SAMPLE_CLK);\r
+  pong_q  <= pong_i when rising_edge(SAMPLE_CLK);\r
+  ping_qq <= ping_q when rising_edge(SAMPLE_CLK);\r
+  pong_qq <= pong_q when rising_edge(SAMPLE_CLK);\r
+  \r
+---------------------------------------------------------------------------\r
+-- outputs\r
+---------------------------------------------------------------------------\r
+  PING_OUT <= ping_qq;\r
+  PONG_OUT <= pong_qq;\r
+\r
+end architecture;\r
index 0e8b60d2e62397c6d8dce383358ff4a8b547e9fa..39dc808f22c29e5b5b0592a79fc4f2c89506ac8e 100644 (file)
@@ -39,8 +39,6 @@ architecture ddmtd_arch of ddmtd is
   );
   end component deglitch;
 
-  signal ping_q        : std_logic_vector(2 downto 0);
-  signal pong_q        : std_logic_vector(2 downto 0);
   signal toggle_q      : std_logic;
   signal start_ping_i  : std_logic;
   signal start_pong_i  : std_logic;
@@ -67,10 +65,6 @@ begin
 THE_SAMPLER_PROC: process( AUXCLK )
 begin
   if( rising_edge(AUXCLK) ) then
-    -- shift register for metastability
-    ping_q        <= ping_q(1 downto 0) & PING_IN;
-    pong_q        <= pong_q(1 downto 0) & PONG_IN;
-    -- register stages
                delay_valid   <= delay_store;
   end if;
 end process THE_SAMPLER_PROC;
@@ -80,7 +74,7 @@ THE_PING_DEGLITCH: deglitch
 port map(
   AUXCLK     => AUXCLK,
   RESET      => RESET,
-  SIGNAL_IN  => ping_q(1),
+  SIGNAL_IN  => PING_IN,
   START_OUT  => start_ping_i
 );
 
@@ -89,7 +83,7 @@ THE_PONG_DEGLITCH: deglitch
 port map(
   AUXCLK     => AUXCLK,
   RESET      => RESET,
-  SIGNAL_IN  => pong_q(1),
+  SIGNAL_IN  => PONG_IN,
   START_OUT  => start_pong_i
 );
 
@@ -145,8 +139,8 @@ begin
   end if;
 end process THE_TOGGLE_PROC;
 
-PING_OUT         <= ping_q(1);
-PONG_OUT         <= pong_q(1);
+PING_OUT         <= PING_IN;
+PONG_OUT         <= PONG_IN;
 START_PING_OUT   <= start_ping_i;
 START_PONG_OUT   <= start_pong_i;
 DELAY_VALUE_OUT  <= delay_data;