# Makefile # Version 2.0 # $Id$ #WINGDB=alice/alice123@pvss01/wing WINGDB = $(shell printf '%s/%s@%s' \ $$(awk '$$1=="Wing_User" {print $$3}' < /etc/trd/wingdb.conf) \ $$(awk '$$1=="Wing_Password" {print $$3}' < /etc/trd/wingdb.conf) \ $$(awk '$$1=="Wing_Dbname" {print $$3}' < /etc/trd/wingdb.conf) ) WINGDB_CONN_CMD="awk '/Wing_User/{u=$3} /Wing_Password/{p=$3} /Wing_Dbname/{d=$3} END {print u"/"p"@"d} ' < /etc/trd/wingdb.conf" SHELL = /bin/bash # Directories #CONFIG_DIR = configurations # CONFIG_DIR = configurations_3tr SRC_DIR = src BUILD_DIR ?= $(shell pwd) # Programs used SQLLDR ?= /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlldr DOSUNIX ?= dos2unix --keepdate -q # -Ve : overflow as error not as warning # -g : ignore all ORG directives (set the start address at some point in program) ASM_OPTIONS=-Ve -g .PHONY: upload/% show clean upload/%: ninja $@ .PRECIOUS: upload/%.sqlldr upload_%: upload/%.sqlldr $(SQLLDR) $(WINGDB) control=$< show: ## show the found bundles, configs and scripts $(PYTHON) generate.py dump clean: ## clean up build files ninja -t clean $(CONFIG_DIR)/test.dat: rob_config: $(CONFIG_DIR)/test.dat topti_cnf -i $^ -o $(config_of_rob3a)/sc_send_rob.dat --rob_pos 4 -d $(config_of_rob3a)/config_dump.txt scp $(config_of_rob3a)/sc_send_rob.dat angelov@va-tosh:TRD.svn/TRAPconfig/cnf_rob ./src/common/patch_single_rob3a_sim.dat: ./src/common/patch_single_rob3a_sim.tcs $(TCC) $^ > ./src/common/patch_single_rob3a_sim.dat rob_sim: $(CONFIG_DIR)/test.dat ./src/common/patch_single_rob3a_sim.tcs $(TCC) ./src/common/patch_single_rob3a_sim.tcs > ./src/common/patch_single_rob3a_sim.dat topti_cnf -i $< -o $(simulation_of_rob3a)/sc_send.dat -p ./src/common/patch_single_rob3a_sim.dat --rob_pos 4 --pmask 0x3000F --no_imem -d $(simulation_of_rob3a)/config_dump.txt cp ./src/common/fitred.imem0.hex $(simulation_of_rob3a)/imem0.hex cp ./src/common/fitred.imem1.hex $(simulation_of_rob3a)/imem1.hex cp ./src/common/fitred.imem2.hex $(simulation_of_rob3a)/imem2.hex cp ./src/common/fitred.imem3.hex $(simulation_of_rob3a)/imem3.hex @grep -i 'warning\|error' $(BUILD_DIR)/src/common/fitred.cpu?.log # init the ROB init: @echo "*** Send the scsn commands to the ROB3A via scsn" $(program) -i $(config_of_rob3a)/sc_send_rob.dat -o $(config_of_rob3a)/out @echo "*** Send one pretrigger 5 - go to acq mode" $(program_pre) 5 # switch to acq mode @echo "*** Clear the ORI receiver" $(program_rx_reset) -rm $(data_va)/* @echo "*** Send one pretrigger 1 - first event is configuration send!" $(program_pre) 1 # first event with configuration $(program_rx_get) $(data_va)/evn00000001.txt tdump_packed $(data_va)/evn00000001.txt > $(config_of_rob3a)/unpacked_cnf # unpack the configuration @echo "*** Dump only two registers from the unpacked received configuration" grep "SMMODE" $(config_of_rob3a)/unpacked_cnf grep "ADCMSK" $(config_of_rob3a)/unpacked_cnf @sleep 2 @echo "*** Dump the state of the TRAPs" @$(program_scsn_peek) smcmd pre1000: $(program_pre) 1 1000 300 pre: $(program_rx_reset) -rm $(data_va)/* $(data_va)/evn00000001.txt $(program_pre) 1 $(program_rx_get) $(data_va)/evn00000001.txt read_raw -d 1 -i1 $(data_va)/evn00000001.txt -o1 data/ pre1000r: pre1000 pre pow_cyc: pow_off pow_on pow_off: @echo "*** Turn ROB power off" $(program) --rob_off sleep 2 pow_on: @echo "*** Turn ROB power on" $(program) --rob_on sleep 1 rob_all: rob_config pow_cyc init # EOF