Commit f5c7ab6b authored by David Cussans's avatar David Cussans

Commiting local changes

Putting directory with OHWR as remote repo ( /projects/HEP_Instrumentation/cad/designs/fmc-mtlu/fmc-mtlu/firmware/AIDA_tlu )
into sync with
directory with Github/DavidCussans ( /users/phdgc/tlu-tmp-2018-5-8/work/build/src/firmware_AIDA )
parent 9c039006
library IEEE;
use IEEE.Std_logic_1164.all;
use IEEE.Numeric_Std.all;
entity syncGenerator_tb is
end;
architecture bench of syncGenerator_tb is
constant g_NUM_TRIG_SOURCES : positive := 6;
constant g_IPBUS_WIDTH : positive := 32;
constant g_COUNTER_WIDTH : positive := 20;
signal clock_i: STD_LOGIC;
signal reset_i: STD_LOGIC;
signal strobe_i: STD_LOGIC;
signal trigger_sources_i: STD_LOGIC_VECTOR(g_NUM_TRIG_SOURCES-1 downto 0) := ( others => '0');
signal trigger_source_select_i: STD_LOGIC_VECTOR(g_IPBUS_WIDTH-1 downto 0);
signal threshold_t1_i, threshold_t2_i, threshold_t3_i: STD_LOGIC_VECTOR(g_IPBUS_WIDTH-1 downto 0);
signal enable_sequence_i: std_logic;
signal enable_internal_cycle_i: std_logic;
signal internal_cycle_length_i: STD_LOGIC_VECTOR(g_IPBUS_WIDTH-1 downto 0);
signal shutter_o: STD_LOGIC;
signal trigger_veto_o: STD_LOGIC ;
constant clock_period: time := 10 ns;
signal stop_the_clock: boolean;
signal s_strobe_counter : natural := 0; -- cycles through 0-3
signal s_cycle_counter : natural := 0; -- cycles through 0-3
begin
-- Insert values for generic parameters !!
uut: entity work.syncGenerator generic map ( g_COUNTER_WIDTH => g_COUNTER_WIDTH ,
g_IPBUS_WIDTH => g_IPBUS_WIDTH,
g_NUM_TRIG_SOURCES => g_NUM_TRIG_SOURCES )
port map ( clock_i => clock_i,
reset_i => reset_i,
strobe_i => strobe_i,
trigger_sources_i => trigger_sources_i,
trigger_source_select_i => trigger_source_select_i,
threshold_t1_i => threshold_t1_i,
threshold_t2_i => threshold_t2_i,
threshold_t3_i => threshold_t3_i,
enable_sequence_i => enable_sequence_i,
enable_internal_cycle_i => enable_internal_cycle_i,
internal_cycle_length_i => internal_cycle_length_i,
shutter_o => shutter_o,
trigger_veto_o => trigger_veto_o );
stimulus: process
begin
trigger_source_select_i <= std_logic_vector(to_unsigned(5,trigger_source_select_i'length));
threshold_t1_i <= std_logic_vector(to_unsigned(100, threshold_t1_i'length));
threshold_t2_i <= std_logic_vector(to_unsigned(200, threshold_t2_i'length));
threshold_t3_i <= std_logic_vector(to_unsigned(300, threshold_t3_i'length));
internal_cycle_length_i <= std_logic_vector(to_unsigned(1024, internal_cycle_length_i'length));
enable_sequence_i <= '1';
enable_internal_cycle_i <='0';
-- Put initialisation code here
reset_i <= '1';
wait for clock_period*4;
reset_i <= '0';
-- Put test bench stimulus code here
wait for clock_period * 1000000;
stop_the_clock <= true;
wait;
end process;
clocking: process
begin
while not stop_the_clock loop
clock_i <= '0', '1' after clock_period / 2;
wait for clock_period;
end loop;
wait;
end process;
p_strobe: process (clock_i)
begin -- process p_strobe
if rising_edge(clock_i) then
s_cycle_counter <= (s_cycle_counter + 1 );
end if;
end process p_strobe;
strobe_i <= '1' when (s_strobe_counter mod 4) = 0 else '0';
trigger_sources_i(5) <= '1' when s_strobe_counter mod 51 = 0 else '0';
end;
......@@ -129,84 +129,8 @@ create_clock -period 25.000 -name sysclk_40_i_p -waveform {0.000 12.500} [get_po
set_input_delay -clock [get_clocks [get_clocks -of_objects [get_pins I4/pll_base_inst/CLKOUT0]]] -rise -min 0.300 [get_ports -regexp -filter { NAME =~ ".*thresh.*" && DIRECTION == "IN" }]
set_input_delay -clock [get_clocks [get_clocks -of_objects [get_pins I4/pll_base_inst/CLKOUT0]]] -rise -max 1.400 [get_ports -regexp -filter { NAME =~ ".*thresh.*" && DIRECTION == "IN" }]
set_clock_groups -asynchronous -group [list [get_clocks clk_ipb_i] [get_clocks sysclk]] -group [list [get_clocks s_clk160] [get_clocks sysclk_40_i_p]]
connect_debug_port u_ila_0/probe13 [get_nets [list shutter_veto_o]]
connect_debug_port u_ila_0/probe16 [get_nets [list veto_i]]
create_debug_core u_ila_0 ila
set_property ALL_PROBE_SAME_MU true [get_debug_cores u_ila_0]
set_property ALL_PROBE_SAME_MU_CNT 1 [get_debug_cores u_ila_0]
set_property C_ADV_TRIGGER false [get_debug_cores u_ila_0]
set_property C_DATA_DEPTH 1024 [get_debug_cores u_ila_0]
set_property C_EN_STRG_QUAL false [get_debug_cores u_ila_0]
set_property C_INPUT_PIPE_STAGES 1 [get_debug_cores u_ila_0]
set_property C_TRIGIN_EN false [get_debug_cores u_ila_0]
set_property C_TRIGOUT_EN false [get_debug_cores u_ila_0]
set_property port_width 1 [get_debug_ports u_ila_0/clk]
connect_debug_port u_ila_0/clk [get_nets [list I4/clk_4x_logic_o]]
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe0]
set_property port_width 4 [get_debug_ports u_ila_0/probe0]
connect_debug_port u_ila_0/probe0 [get_nets [list {I9/s_DUT_ignore_busy[0]} {I9/s_DUT_ignore_busy[1]} {I9/s_DUT_ignore_busy[2]} {I9/s_DUT_ignore_busy[3]}]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe1]
set_property port_width 6 [get_debug_ports u_ila_0/probe1]
connect_debug_port u_ila_0/probe1 [get_nets [list {I5/trigger_o[0]} {I5/trigger_o[1]} {I5/trigger_o[2]} {I5/trigger_o[3]} {I5/trigger_o[4]} {I5/trigger_o[5]}]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe2]
set_property port_width 6 [get_debug_ports u_ila_0/probe2]
connect_debug_port u_ila_0/probe2 [get_nets [list {I10/trigger_o[0]} {I10/trigger_o[1]} {I10/trigger_o[2]} {I10/trigger_o[3]} {I10/trigger_o[4]} {I10/trigger_o[5]}]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe3]
set_property port_width 6 [get_debug_ports u_ila_0/probe3]
connect_debug_port u_ila_0/probe3 [get_nets [list {triggers[0]} {triggers[1]} {triggers[2]} {triggers[3]} {triggers[4]} {triggers[5]}]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe4]
set_property port_width 1 [get_debug_ports u_ila_0/probe4]
connect_debug_port u_ila_0/probe4 [get_nets [list buffer_full_i]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe5]
set_property port_width 1 [get_debug_ports u_ila_0/probe5]
connect_debug_port u_ila_0/probe5 [get_nets [list I9/s_IgnoreShutterVeto]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe6]
set_property port_width 1 [get_debug_ports u_ila_0/probe6]
connect_debug_port u_ila_0/probe6 [get_nets [list I10/s_post_veto_trigger0]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe7]
set_property port_width 1 [get_debug_ports u_ila_0/probe7]
connect_debug_port u_ila_0/probe7 [get_nets [list I10/s_post_veto_trigger1]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe8]
set_property port_width 1 [get_debug_ports u_ila_0/probe8]
connect_debug_port u_ila_0/probe8 [get_nets [list I10/s_pre_veto_trigger_reg_n_0]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe9]
set_property port_width 1 [get_debug_ports u_ila_0/probe9]
connect_debug_port u_ila_0/probe9 [get_nets [list I8/cmp_SyncGen/s_shutter]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe10]
set_property port_width 1 [get_debug_ports u_ila_0/probe10]
connect_debug_port u_ila_0/probe10 [get_nets [list s_shutter]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe11]
set_property port_width 1 [get_debug_ports u_ila_0/probe11]
connect_debug_port u_ila_0/probe11 [get_nets [list I8/cmp_SyncGen/s_trigger]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe12]
set_property port_width 1 [get_debug_ports u_ila_0/probe12]
connect_debug_port u_ila_0/probe12 [get_nets [list I6/s_trigger]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe13]
set_property port_width 1 [get_debug_ports u_ila_0/probe13]
connect_debug_port u_ila_0/probe13 [get_nets [list I6/trigger_i]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe14]
set_property port_width 1 [get_debug_ports u_ila_0/probe14]
connect_debug_port u_ila_0/probe14 [get_nets [list I10/cmp_coincidence_logic/trigger_o]]
create_debug_port u_ila_0 probe
set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe15]
set_property port_width 1 [get_debug_ports u_ila_0/probe15]
connect_debug_port u_ila_0/probe15 [get_nets [list I9/veto_o]]
set_property C_CLK_INPUT_FREQ_HZ 300000000 [get_debug_cores dbg_hub]
set_property C_ENABLE_CLK_DIVIDER false [get_debug_cores dbg_hub]
set_property C_USER_SCAN_CHAIN 1 [get_debug_cores dbg_hub]
connect_debug_port dbg_hub/clk [get_nets clk_4x_logic]
......@@ -96,7 +96,7 @@ zeClock.checkDesignID()
#zeClock.setPage(0, True)
#zeClock.getPage(True)
#clkRegList= zeClock.parse_clk("./../../bitFiles/TLU_CLK_Config_v1e.txt")
clkRegList= zeClock.parse_clk("./localClock.txt")
clkRegList= zeClock.parse_clk("./localClock.txt",verbose=True)
zeClock.writeConfiguration(clkRegList)######
zeClock.writeRegister(0x0536, [0x0A]) #Configures manual switch of inputs
......
/projects/HEP_Instrumentation/cad/designs/fmc-mtlu/fmc-mtlu.sav/circuit_board/Cadence/worklib/fmc_tlu_toplevel_e/physical/clockConfiguration/DUNE_TLU-DUNTLU09-Registers.txt
\ No newline at end of file
/projects/HEP_Instrumentation/cad/designs/fmc-mtlu/fmc-mtlu/circuit_board/Cadence/worklib/fmc_tlu_toplevel_e/physical/ClockGen/Si5345-RevB-NEWTLU04-v2-15-Registers.txt
\ No newline at end of file
/projects/HEP_Instrumentation/cad/designs/fmc-mtlu/fmc-mtlu/circuit_board/Cadence/worklib/fmc_tlu_toplevel_e/physical/ClockGen/TLU_Si5345-RevB-NEWTLU02-PDTS-ExternalClk_Project-Registers.txt
\ No newline at end of file
/projects/HEP_Instrumentation/cad/designs/fmc-mtlu/fmc-mtlu/circuit_board/Cadence/worklib/fmc_tlu_toplevel_e/physical/ClockGen/TLU_Si5345-RevB-NEWTLU03-PDTS-FreeRun_Project-Registers.txt
\ No newline at end of file
/projects/HEP_Instrumentation/cad/designs/fmc-mtlu/fmc-mtlu/circuit_board/Cadence/worklib/fmc_tlu_toplevel_e/physical/ClockGen/TLU_Si5345-RevB-NEWTLU04-PDTS-FreeRun_Project-Registers.txt
\ No newline at end of file
......@@ -351,7 +351,7 @@ class TLU:
return clockStatus
def getDUTmask(self):
DUTMaskR = self.hw.getNode("DUTInterfaces.DutMaskR").read()
DUTMaskR = self.hw.getNode("DUTInterfaces.DUTMaskR").read()
self.hw.dispatch()
print "\tDUTMask read back as:" , hex(DUTMaskR)
return DUTMaskR
......@@ -466,25 +466,25 @@ class TLU:
return IgnoreShutterVeto
def getShutterControl(self):
shutterControl = self.hw.getNode("Shutter.ControlW").read()
shutterControl = self.hw.getNode("Shutter.ControlRW").read()
self.hw.dispatch()
print "\tShutter control read back as:" , hex(shutterControl)
return shutterControl
def getShutterSource(self):
shutterSource = self.hw.getNode("Shutter.ShutterSelectW").read()
shutterSource = self.hw.getNode("Shutter.ShutterSelectRW").read()
self.hw.dispatch()
print "\tShutter source read back as:" , shutterSource
return shutterSource
def getShutterInternalInterval(self):
shutterInternalInterval = self.hw.getNode("Shutter.InternalShutterPeriodW").read()
shutterInternalInterval = self.hw.getNode("Shutter.InternalShutterPeriodRW").read()
self.hw.dispatch()
print "\tShutter internal inverval read back as:" , shutterInternalInterval
return shutterInternalInterval
def getShutterOnTime(self):
shutterontime = self.hw.getNode("Shutter.ShutterOnTimeW").read()
shutterontime = self.hw.getNode("Shutter.ShutterOnTimeRW").read()
self.hw.dispatch()
print "\tShutter on time:" , shutterontime
return shutterontime
......@@ -593,7 +593,7 @@ class TLU:
def setDUTmask(self, DUTMask):
print " DUT MASK ENABLING: Mask= " , hex(DUTMask)
self.hw.getNode("DUTInterfaces.DutMaskW").write(DUTMask)
self.hw.getNode("DUTInterfaces.DUTMaskW").write(DUTMask)
self.hw.dispatch()
self.getDUTmask()
......@@ -629,27 +629,29 @@ class TLU:
def setShutterControl(self, controlWord):
print " SHUTTER CONTROL:", hex(controlWord)
self.hw.getNode("Shutter.ControlW").write(controlWord)
self.hw.getNode("Shutter.ControlRW").write(controlWord)
self.hw.dispatch()
self.getShutterControl()
def setShutterSource(self, source):
print " SHUTTER SOURCE:", hex(source)
self.hw.getNode("Shutter.ShutterSelectW").write(source)
self.hw.getNode("Shutter.ShutterSelectRW").write(source)
self.hw.dispatch()
self.getShutterSource()
## Fixme!!
def setShutterInternalInterval(self, interval):
print " SHUTTER INTERNAL INTERVAL:", interval
self.hw.getNode("Shutter.InternalShutterPeriodW").write(interval)
self.hw.dispatch()
self.getShutterInternalInterval()
#self.hw.getNode("Shutter.InternalShutterPeriodRW").write(interval)
#self.hw.dispatch()
#self.getShutterInternalInterval()
## Fixme!
def setShutterOnTime(self, cycles):
print " SHUTTER ON TIME:", cycles
self.hw.getNode("Shutter.ShutterOnTimeW").write(cycles)
self.hw.dispatch()
self.getShutterOnTime()
#self.hw.getNode("Shutter.ShutterOnTimeRW").write(cycles)
#self.hw.dispatch()
#self.getShutterOnTime()
def setShutterOffTime(self, cycles):
print " SHUTTER OFF TIME:", cycles
......
......@@ -2,5 +2,8 @@
<connections>
<connection id="tlu" uri="ipbusudp-2.0://192.168.200.30:50001"
address_table="file://./TLUaddrmap.xml" />
address_table="file://./TLUaddrmap.xml" />
<connection id="fnal_tlu" uri="ipbusudp-2.0://192.168.121.10:50001"
address_table="file://./TLUaddrmap.xml" />
</connections>
# Si538x/4x Registers Export
#
# Part: Si5345
# Project File: P:\cad\designs\fmc-mtlu\trunk\circuit_board\Cadence\worklib\fmc_tlu_toplevel_c\physical\ClockGen\TLU_Si5345-RevB-NEWTLU00-Project.slabtimeproj
# Design ID: TLU1E_01
# Includes Pre/Post Download Control Register Writes: Yes
# Die Revision: A2
# Creator: ClockBuilder Pro v2.12.1 [2016-12-15]
# Created On: 2017-08-24 13:37:41 GMT+01:00
Address,Data
0x0B24,0xD8
0x0B25,0x00
0x000B,0x68
0x0016,0x02
0x0017,0x1C
0x0018,0x88
0x0019,0xDD
0x001A,0xDF
0x002B,0x02
0x002C,0x07
0x002D,0x15
0x002E,0x37
0x002F,0x00
0x0030,0x37
0x0031,0x00
0x0032,0x37
0x0033,0x00
0x0034,0x00
0x0035,0x00
0x0036,0x37
0x0037,0x00
0x0038,0x37
0x0039,0x00
0x003A,0x37
0x003B,0x00
0x003C,0x00
0x003D,0x00
0x003F,0x77
0x0040,0x04
0x0041,0x0C
0x0042,0x0C
0x0043,0x0C
0x0044,0x00
0x0045,0x0C
0x0046,0x32
0x0047,0x32
0x0048,0x32
0x0049,0x00
0x004A,0x32
0x004B,0x32
0x004C,0x32
0x004D,0x00
0x004E,0x55
0x004F,0x05
0x0051,0x03
0x0052,0x03
0x0053,0x03
0x0054,0x00
0x0055,0x03
0x0056,0x03
0x0057,0x03
0x0058,0x00
0x0059,0x3F
0x005A,0xCC
0x005B,0xCC
0x005C,0xCC
0x005D,0x00
0x005E,0xCC
0x005F,0xCC
0x0060,0xCC
0x0061,0x00
0x0062,0xCC
0x0063,0xCC
0x0064,0xCC
0x0065,0x00
0x0066,0x00
0x0067,0x00
0x0068,0x00
0x0069,0x00
0x0092,0x00
0x0093,0x00
0x0095,0x00
0x0096,0x00
0x0098,0x00
0x009A,0x02
0x009B,0x30
0x009D,0x00
0x009E,0x20
0x00A0,0x00
0x00A2,0x02
0x00A8,0x89
0x00A9,0x70
0x00AA,0x07
0x00AB,0x00
0x00AC,0x00
0x0102,0x01
0x0108,0x06
0x0109,0x09
0x010A,0x33
0x010B,0x00
0x010D,0x06
0x010E,0x09
0x010F,0x33
0x0110,0x00
0x0112,0x06
0x0113,0x09
0x0114,0x33
0x0115,0x00
0x0117,0x06
0x0118,0x09
0x0119,0x33
0x011A,0x00
0x011C,0x06
0x011D,0x09
0x011E,0x33
0x011F,0x00
0x0121,0x06
0x0122,0x09
0x0123,0x33
0x0124,0x00
0x0126,0x06
0x0127,0x09
0x0128,0x33
0x0129,0x00
0x012B,0x06
0x012C,0x09
0x012D,0x33
0x012E,0x00
0x0130,0x06
0x0131,0x09
0x0132,0x33
0x0133,0x00
0x013A,0x01
0x013B,0xCC
0x013C,0x00
0x013D,0x00
0x013F,0x00
0x0140,0x00
0x0141,0x40
0x0142,0xFF
0x0202,0x00
0x0203,0x00
0x0204,0x00
0x0205,0x00
0x0206,0x00
0x0208,0x14
0x0209,0x00
0x020A,0x00
0x020B,0x00
0x020C,0x00
0x020D,0x00
0x020E,0x01
0x020F,0x00
0x0210,0x00
0x0211,0x00
0x0212,0x14
0x0213,0x00
0x0214,0x00
0x0215,0x00
0x0216,0x00
0x0217,0x00
0x0218,0x01
0x0219,0x00
0x021A,0x00
0x021B,0x00
0x021C,0x14
0x021D,0x00
0x021E,0x00
0x021F,0x00
0x0220,0x00
0x0221,0x00
0x0222,0x01
0x0223,0x00
0x0224,0x00
0x0225,0x00
0x0226,0x00
0x0227,0x00
0x0228,0x00
0x0229,0x00
0x022A,0x00
0x022B,0x00
0x022C,0x00
0x022D,0x00
0x022E,0x00
0x022F,0x00
0x0231,0x01
0x0232,0x01
0x0233,0x01
0x0234,0x01
0x0235,0x00
0x0236,0x00
0x0237,0x00
0x0238,0x00
0x0239,0xA9
0x023A,0x00
0x023B,0x00
0x023C,0x00
0x023D,0x00
0x023E,0xA0
0x024A,0x00
0x024B,0x00
0x024C,0x00
0x024D,0x00
0x024E,0x00
0x024F,0x00
0x0250,0x00
0x0251,0x00
0x0252,0x00
0x0253,0x00
0x0254,0x00
0x0255,0x00
0x0256,0x00
0x0257,0x00
0x0258,0x00
0x0259,0x00
0x025A,0x00
0x025B,0x00
0x025C,0x00
0x025D,0x00
0x025E,0x00
0x025F,0x00
0x0260,0x00
0x0261,0x00
0x0262,0x00
0x0263,0x00
0x0264,0x00
0x0268,0x00
0x0269,0x00
0x026A,0x00
0x026B,0x54
0x026C,0x4C
0x026D,0x55
0x026E,0x31
0x026F,0x45
0x0270,0x5F
0x0271,0x30
0x0272,0x31
0x0302,0x00
0x0303,0x00
0x0304,0x00
0x0305,0x80
0x0306,0x54
0x0307,0x00
0x0308,0x00
0x0309,0x00
0x030A,0x00
0x030B,0x80
0x030C,0x00
0x030D,0x00
0x030E,0x00
0x030F,0x00
0x0310,0x00
0x0311,0x00
0x0312,0x00
0x0313,0x00
0x0314,0x00
0x0315,0x00
0x0316,0x00
0x0317,0x00
0x0318,0x00
0x0319,0x00
0x031A,0x00
0x031B,0x00
0x031C,0x00
0x031D,0x00
0x031E,0x00
0x031F,0x00
0x0320,0x00
0x0321,0x00
0x0322,0x00
0x0323,0x00
0x0324,0x00
0x0325,0x00
0x0326,0x00
0x0327,0x00
0x0328,0x00
0x0329,0x00
0x032A,0x00
0x032B,0x00
0x032C,0x00
0x032D,0x00
0x032E,0x00
0x032F,0x00
0x0330,0x00
0x0331,0x00
0x0332,0x00
0x0333,0x00
0x0334,0x00
0x0335,0x00
0x0336,0x00
0x0337,0x00
0x0338,0x00
0x0339,0x1F
0x033B,0x00
0x033C,0x00
0x033D,0x00
0x033E,0x00
0x033F,0x00
0x0340,0x00
0x0341,0x00
0x0342,0x00
0x0343,0x00
0x0344,0x00
0x0345,0x00
0x0346,0x00
0x0347,0x00
0x0348,0x00
0x0349,0x00
0x034A,0x00
0x034B,0x00
0x034C,0x00
0x034D,0x00
0x034E,0x00
0x034F,0x00
0x0350,0x00
0x0351,0x00
0x0352,0x00
0x0353,0x00
0x0354,0x00
0x0355,0x00
0x0356,0x00
0x0357,0x00
0x0358,0x00
0x0359,0x00
0x035A,0x00
0x035B,0x00
0x035C,0x00
0x035D,0x00
0x035E,0x00
0x035F,0x00
0x0360,0x00
0x0361,0x00
0x0362,0x00
0x0487,0x00
0x0502,0x01
0x0508,0x14
0x0509,0x23
0x050A,0x0C
0x050B,0x0B
0x050C,0x03
0x050D,0x3F
0x050E,0x17
0x050F,0x2B
0x0510,0x09
0x0511,0x08
0x0512,0x03
0x0513,0x3F
0x0515,0x00
0x0516,0x00
0x0517,0x00
0x0518,0x00
0x0519,0xA4
0x051A,0x02
0x051B,0x00
0x051C,0x00
0x051D,0x00
0x051E,0x00
0x051F,0x80
0x0521,0x21
0x052A,0x05
0x052B,0x01
0x052C,0x0F
0x052D,0x03
0x052E,0x19
0x052F,0x19
0x0531,0x00
0x0532,0x42
0x0533,0x03
0x0534,0x00
0x0535,0x00
0x0536,0x08
0x0537,0x00
0x0538,0x00
0x0539,0x00
0x0802,0x35
0x0803,0x05
0x0804,0x00
0x090E,0x02
0x0943,0x00
0x0949,0x07
0x094A,0x07
0x0A02,0x00
0x0A03,0x01
0x0A04,0x01
0x0A05,0x01
0x0B44,0x2F
0x0B46,0x00
0x0B47,0x00
0x0B48,0x08
0x0B4A,0x1E
0x0514,0x01
0x001C,0x01
0x0B24,0xDB
0x0B25,0x02
# Si538x/4x Registers Export
#
# Part: Si5345
# Project File: P:\cad\designs\fmc-mtlu\trunk\circuit_board\Cadence\worklib\fmc_tlu_toplevel_c\physical\ClockGen\TLU_Si5345-RevB-NEWTLU00-Project.slabtimeproj
# Design ID: TLU1E_01
# Includes Pre/Post Download Control Register Writes: Yes
# Die Revision: A2
# Creator: ClockBuilder Pro v2.12.1 [2016-12-15]
# Created On: 2017-08-24 13:37:41 GMT+01:00
Address,Data
0x0B24,0xD8
0x0B25,0x00
0x000B,0x68
0x0016,0x02
0x0017,0x1C
0x0018,0x88
0x0019,0xDD
0x001A,0xDF
0x002B,0x02
0x002C,0x07
0x002D,0x15
0x002E,0x37
0x002F,0x00
0x0030,0x37
0x0031,0x00
0x0032,0x37
0x0033,0x00
0x0034,0x00
0x0035,0x00
0x0036,0x37
0x0037,0x00
0x0038,0x37
0x0039,0x00
0x003A,0x37
0x003B,0x00
0x003C,0x00
0x003D,0x00
0x003F,0x77
0x0040,0x04
0x0041,0x0C
0x0042,0x0C
0x0043,0x0C
0x0044,0x00
0x0045,0x0C
0x0046,0x32
0x0047,0x32
0x0048,0x32
0x0049,0x00
0x004A,0x32
0x004B,0x32
0x004C,0x32
0x004D,0x00
0x004E,0x55
0x004F,0x05
0x0051,0x03
0x0052,0x03
0x0053,0x03
0x0054,0x00
0x0055,0x03
0x0056,0x03
0x0057,0x03
0x0058,0x00
0x0059,0x3F
0x005A,0xCC
0x005B,0xCC
0x005C,0xCC
0x005D,0x00
0x005E,0xCC
0x005F,0xCC
0x0060,0xCC
0x0061,0x00
0x0062,0xCC
0x0063,0xCC
0x0064,0xCC
0x0065,0x00
0x0066,0x00
0x0067,0x00
0x0068,0x00
0x0069,0x00
0x0092,0x00
0x0093,0x00
0x0095,0x00
0x0096,0x00
0x0098,0x00
0x009A,0x02
0x009B,0x30
0x009D,0x00
0x009E,0x20
0x00A0,0x00
0x00A2,0x02
0x00A8,0x89
0x00A9,0x70
0x00AA,0x07
0x00AB,0x00
0x00AC,0x00
0x0102,0x01
0x0108,0x06
0x0109,0x09
0x010A,0x33
0x010B,0x00
0x010D,0x06
0x010E,0x09
0x010F,0x33
0x0110,0x00
0x0112,0x06
0x0113,0x09
0x0114,0x33
0x0115,0x00
0x0117,0x06
0x0118,0x09
0x0119,0x33
0x011A,0x00
0x011C,0x06
0x011D,0x09
0x011E,0x33
0x011F,0x00
0x0121,0x06
0x0122,0x09
0x0123,0x33
0x0124,0x00
0x0126,0x06
0x0127,0x09
0x0128,0x33
0x0129,0x00
0x012B,0x06
0x012C,0x09
0x012D,0x33
0x012E,0x00
0x0130,0x06
0x0131,0x09
0x0132,0x33
0x0133,0x00
0x013A,0x01
0x013B,0xCC
0x013C,0x00
0x013D,0x00
0x013F,0x00
0x0140,0x00
0x0141,0x40
0x0142,0xFF
0x0202,0x00
0x0203,0x00
0x0204,0x00
0x0205,0x00
0x0206,0x00
0x0208,0x14
0x0209,0x00
0x020A,0x00
0x020B,0x00
0x020C,0x00
0x020D,0x00
0x020E,0x01
0x020F,0x00
0x0210,0x00
0x0211,0x00
0x0212,0x14
0x0213,0x00
0x0214,0x00
0x0215,0x00
0x0216,0x00
0x0217,0x00
0x0218,0x01
0x0219,0x00
0x021A,0x00
0x021B,0x00
0x021C,0x14
0x021D,0x00
0x021E,0x00
0x021F,0x00
0x0220,0x00
0x0221,0x00
0x0222,0x01
0x0223,0x00
0x0224,0x00
0x0225,0x00
0x0226,0x00
0x0227,0x00
0x0228,0x00
0x0229,0x00
0x022A,0x00
0x022B,0x00
0x022C,0x00
0x022D,0x00
0x022E,0x00
0x022F,0x00
0x0231,0x01
0x0232,0x01
0x0233,0x01
0x0234,0x01
0x0235,0x00
0x0236,0x00
0x0237,0x00
0x0238,0x00
0x0239,0xA9
0x023A,0x00
0x023B,0x00
0x023C,0x00
0x023D,0x00
0x023E,0xA0
0x024A,0x00
0x024B,0x00
0x024C,0x00
0x024D,0x00
0x024E,0x00
0x024F,0x00
0x0250,0x00
0x0251,0x00
0x0252,0x00
0x0253,0x00
0x0254,0x00
0x0255,0x00
0x0256,0x00
0x0257,0x00
0x0258,0x00
0x0259,0x00
0x025A,0x00
0x025B,0x00
0x025C,0x00
0x025D,0x00
0x025E,0x00
0x025F,0x00
0x0260,0x00
0x0261,0x00
0x0262,0x00
0x0263,0x00
0x0264,0x00
0x0268,0x00
0x0269,0x00
0x026A,0x00
0x026B,0x54
0x026C,0x4C
0x026D,0x55
0x026E,0x31
0x026F,0x45
0x0270,0x5F
0x0271,0x30
0x0272,0x31
0x0302,0x00
0x0303,0x00
0x0304,0x00
0x0305,0x80
0x0306,0x54
0x0307,0x00
0x0308,0x00
0x0309,0x00
0x030A,0x00
0x030B,0x80
0x030C,0x00
0x030D,0x00
0x030E,0x00
0x030F,0x00
0x0310,0x00
0x0311,0x00
0x0312,0x00
0x0313,0x00
0x0314,0x00
0x0315,0x00
0x0316,0x00
0x0317,0x00
0x0318,0x00
0x0319,0x00
0x031A,0x00
0x031B,0x00
0x031C,0x00
0x031D,0x00
0x031E,0x00
0x031F,0x00
0x0320,0x00
0x0321,0x00
0x0322,0x00
0x0323,0x00
0x0324,0x00
0x0325,0x00
0x0326,0x00
0x0327,0x00
0x0328,0x00
0x0329,0x00
0x032A,0x00
0x032B,0x00
0x032C,0x00
0x032D,0x00
0x032E,0x00
0x032F,0x00
0x0330,0x00
0x0331,0x00
0x0332,0x00
0x0333,0x00
0x0334,0x00
0x0335,0x00
0x0336,0x00
0x0337,0x00
0x0338,0x00
0x0339,0x1F
0x033B,0x00
0x033C,0x00
0x033D,0x00
0x033E,0x00
0x033F,0x00
0x0340,0x00
0x0341,0x00
0x0342,0x00
0x0343,0x00
0x0344,0x00
0x0345,0x00
0x0346,0x00
0x0347,0x00
0x0348,0x00
0x0349,0x00
0x034A,0x00
0x034B,0x00
0x034C,0x00
0x034D,0x00
0x034E,0x00
0x034F,0x00
0x0350,0x00
0x0351,0x00
0x0352,0x00
0x0353,0x00
0x0354,0x00
0x0355,0x00
0x0356,0x00
0x0357,0x00
0x0358,0x00
0x0359,0x00
0x035A,0x00
0x035B,0x00
0x035C,0x00
0x035D,0x00
0x035E,0x00
0x035F,0x00
0x0360,0x00
0x0361,0x00
0x0362,0x00
0x0487,0x00
0x0502,0x01
0x0508,0x14
0x0509,0x23
0x050A,0x0C
0x050B,0x0B
0x050C,0x03
0x050D,0x3F
0x050E,0x17
0x050F,0x2B
0x0510,0x09
0x0511,0x08
0x0512,0x03
0x0513,0x3F
0x0515,0x00
0x0516,0x00
0x0517,0x00
0x0518,0x00
0x0519,0xA4
0x051A,0x02
0x051B,0x00
0x051C,0x00
0x051D,0x00
0x051E,0x00
0x051F,0x80
0x0521,0x21
0x052A,0x05
0x052B,0x01
0x052C,0x0F
0x052D,0x03
0x052E,0x19
0x052F,0x19
0x0531,0x00
0x0532,0x42
0x0533,0x03
0x0534,0x00
0x0535,0x00
0x0536,0x08
0x0537,0x00
0x0538,0x00
0x0539,0x00
0x0802,0x35
0x0803,0x05
0x0804,0x00
0x090E,0x02
0x0943,0x00
0x0949,0x07
0x094A,0x07
0x0A02,0x00
0x0A03,0x01
0x0A04,0x01
0x0A05,0x01
0x0B44,0x2F
0x0B46,0x00
0x0B47,0x00
0x0B48,0x08
0x0B4A,0x1E
0x0514,0x01
0x001C,0x01
0x0B24,0xDB
0x0B25,0x02
TLU_Si5345-RevB-NEWTLU03-PDTS-FreeRun_Project-Registers.txt
\ No newline at end of file
......@@ -4,6 +4,7 @@ from I2CuHal import I2CCore
import StringIO
import csv
import sys
import time
class si5345:
#Class to configure the Si5344 clock generator
......@@ -105,6 +106,12 @@ class si5345:
if not line.startswith('#') :
if not line.startswith('Address'):
deletedcomments+=line
else:
if "Delay 300" in line: # Have found the string "Delay" in a line starting with #
if verbose:
print "Found delay 300ms command"
time.sleep(0.3)
csvfile = StringIO.StringIO(deletedcomments)
cvr= csv.reader(csvfile, delimiter=',', quotechar='|')
#print "\tN elements parser:", sum(1 for row in cvr)
......
#!/bin/bash
echo "=========================="
CURRENT_DIR=${0%/*}
echo "CURRENT DIRECTORY: " $CURRENT_DIR
echo "============"
echo "SETTING PATHS"
#export PYTHONPATH=$CURRENT_DIR/../../../../../Python_Scripts/PyChips_1_5_0_pre2A/src:$PYTHONPATH
#export PYTHONPATH=~/Python_Scripts/PyChips_1_5_0_pre2A/src:$PYTHONPATH
#export PYTHONPATH=../../packages:$PYTHONPATH
export PYTHONPATH=./packages:$PYTHONPATH
echo "PYTHON PATH= " $PYTHONPATH
export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
echo "LD_LIBRARY_PATH= " $LD_LIBRARY_PATH
export PATH=/usr/bin/:/opt/cactus/bin:$PATH
echo "PATH= " $PATH
#cd $CURRENT_DIR
# -*- coding: utf-8 -*-
import uhal
from I2CuHal import I2CCore
import time
from AD5665R import AD5665R
from E24AA025E48T import E24AA025E48T
manager = uhal.ConnectionManager("file://./TLUconnection.xml")
hw = manager.getDevice("fnal_tlu")
reg = hw.getNode("version").read()
hw.dispatch()
print "Firmware version = ", hex(reg)
# #First I2C core
print ("Instantiating master I2C core:")
master_I2C= I2CCore(hw, 10, 5, "i2c_master", None)
master_I2C.state()
#
# #######################################
enableCore= True #Only need to run this once, after power-up
if (enableCore):
mystop=True
print " Write RegDir to set I/O[7] to output:"
myslave= 0x21
mycmd= [0x01, 0x7F]
nwords= 1
master_I2C.write(myslave, mycmd, mystop)
mystop=False
mycmd= [0x01]
master_I2C.write(myslave, mycmd, mystop)
res= master_I2C.read( myslave, nwords)
print "\tPost RegDir: ", res
#DAC CONFIGURATION BEGIN
zeDAC1=AD5665R(master_I2C, 0x13)
zeDAC1.setIntRef(intRef= False, verbose= True)
zeDAC1.writeDAC(0x0, 7, verbose= True)#7626
zeDAC2=AD5665R(master_I2C, 0x1F)
zeDAC2.setIntRef(intRef= False, verbose= True)
zeDAC2.writeDAC(0x2fff, 3, verbose= True)
#DAC CONFIGURATION END
#EEPROM BEGIN
zeEEPROM= E24AA025E48T(master_I2C, 0x50)
res=zeEEPROM.readEEPROM(0xfa, 6)
result=" EEPROM ID:\n\t"
for iaddr in res:
result+="%02x "%(iaddr)
print result
#EEPROM END
#
# Script to exercise AIDA mini-TLU
#
# David Cussans, December 2012
#
# Hacked to only test internal triggers
from PyChipsUser import *
from FmcTluI2c import *
import sys
import time
def mean(TS):
val=0
for i in range(1,len(TS)):
val+=TS[i]-TS[i-1]
return val/(len(TS)-1)
bAddrTab = AddressTable("./aida_mini_tlu_addr_map.txt")
# Assume DIP-switch controlled address. Switches at 1
board = ChipsBusUdp(bAddrTab,"192.168.200.32",50001)
# Check the bus for I2C devices
boardi2c = FmcTluI2c(board)
firmwareID=board.read("FirmwareId")
print "Firmware = " , hex(firmwareID)
print "Scanning I2C bus:"
scanResults = boardi2c.i2c_scan()
print scanResults
boardId = boardi2c.get_serial_number()
print "FMC-TLU serial number = " , boardId
resetClocks = 0
resetSerdes = 0
# set DACs to -200mV
print "Setting all threshold DAC to -200mV "
boardi2c.set_threshold_voltage(7, -0.05)
clockStatus = board.read("LogicClocksCSR")
print "Clock status = " , hex(clockStatus)
if resetClocks:
print "Resetting clocks"
board.write("LogicRst", 1 )
clockStatus = board.read("LogicClocksCSR")
print "Clock status after reset = " , hex(clockStatus)
inputStatus = board.read("SerdesRstR")
print "Input status = " , hex(inputStatus)
if resetSerdes:
board.write("SerdesRstW", 0x00000003 )
inputStatus = board.read("SerdesRstR")
print "Input status during reset = " , hex(inputStatus)
board.write("SerdesRstW", 0x00000000 )
inputStatus = board.read("SerdesRstR")
print "Input status after reset = " , hex(inputStatus)
board.write("SerdesRstW", 0x00000004 )
inputStatus = board.read("SerdesRstR")
print "Input status during calibration = " , hex(inputStatus)
board.write("SerdesRstW", 0x00000000 )
inputStatus = board.read("SerdesRstR")
print "Input status after calibration = " , hex(inputStatus)
inputStatus = board.read("SerdesRstR")
print "Input status = " , hex(inputStatus)
count0 = board.read("ThrCount0R")
print " Count 0 = " , count0
count1 = board.read("ThrCount1R")
print " Count 1 = " , count1
count2 = board.read("ThrCount2R")
print " Count 2 = " , count2
count3 = board.read("ThrCount3R")
print " Count 3 = " , count3
board.write("InternalTriggerIntervalW",0)
print "Enabling DUT 1"
board.write("DUTMaskW",7)
board.write("TriggerMaskW",0x0)
board.write("TriggerVetoW",0)
print "Trigger inputs enabled: ", board.read("TriggerMaskR")
print "Reseting FIFO"
board.write("EventFifoCSR",0x2)
print "Disabling data recording"
board.write("Enable_Record_Data",0)
print "Enabling handshake: No-handshake"
board.write("HandshakeTypeW",1)
TriggerInterval = 16000000
print "Setting internal trigger interval to " , TriggerInterval
board.write("InternalTriggerIntervalW",TriggerInterval) #0->Internal pulse generator disabled. Any other value will generate pulses with a frequency of n*6.25ns
trigInterval = board.read("InternalTriggerIntervalW")
print "Trigger interval read back as ", trigInterval
numLoops = 500000
for iLoop in range(0,numLoops):
preVetotriggerCount = board.read("PreVetoTriggersR")
postVetotriggerCount = board.read("PostVetoTriggersR")
print "pre , post veto triggers = " , preVetotriggerCount , postVetotriggerCount
time.sleep( 0.5)
board.write("DUTMaskW",0xFFFFFFF7)
time.sleep( 0.5)
board.write("DUTMaskW",0x00000007)
......@@ -4,7 +4,8 @@ from FmcTluI2c import *
import sys
import time
boardIpAddr = "192.168.200.16"
#boardIpAddr = "192.168.200.16"
boardIpAddr = "192.168.200.32"
boardPortNum = 50001
addrTable = AddressTable("./aida_mini_tlu_addr_map.txt")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment