Skip to content

Commit 134c112

Browse files
author
Elijah A-B
committed
First version of hispecatc WDL. not tested, need to implement ResetLO and ResetDummy Waveforms
1 parent de05dad commit 134c112

10 files changed

Lines changed: 667 additions & 153 deletions

File tree

src/hispecatc/Makefile

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# -----------------------------------------------------------------------------
2+
# @file Makefile
3+
# @brief Makefile for Software/Config/Archon/Build/
4+
# @author David Hale
5+
# @date 2015-xx-xx
6+
# @modified 2016-01-14
7+
# @modified 2016-01-27 added fixrawendline (special case for Peter)
8+
# @modified 2016-01-28 removed clean. Use @F.h instead of HFILE=archon.h
9+
# @modified 2016-03-31 change how .mod is parsed
10+
# @modified 2016-04-04 add INCPARSER and checks for file existence
11+
# @modified 2016-04-07 add plotting option and check for WAVGEN exit code
12+
# @modified 2016-04-19 changes to implement INCLUDE_FILE= in *.conf
13+
# @modified 2016-04-20 read CDS_FILE and MODULE_FILE from .conf
14+
# @modified 2017-02-08 added modegen
15+
# @modified 2017-11-09 remove copying of acf files to camera computers
16+
# @modified 2020-12-21 added insert_hash
17+
#
18+
# This Makefile uses the general preprocessor GPP 2.24 for macro processing.
19+
# It also requires the ini2acf.pl Perl script for creating an Archon acf file.
20+
#
21+
# -----------------------------------------------------------------------------
22+
#
23+
24+
# Copyright (C) <2018> California Institute of Technology
25+
# Software written by: <Dave Hale and Peter Mao>
26+
#
27+
# This program is part of the Waveform Definition Language (WDL) developed
28+
# for ZTF. This program is free software: you can redistribute it and/or
29+
# modify it under the terms of the GNU General Public License as published
30+
# by the Free Software Foundation, either version 3 of the License, or
31+
# any later version.
32+
#
33+
# This program is distributed in the hope that it will be useful,
34+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
35+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36+
# GNU General Public License for more details.
37+
#
38+
# Please see the GNU General Public License at:
39+
# <http://www.gnu.org/licenses/>.
40+
#
41+
# Report any bugs or suggested improvements to:
42+
#
43+
# David Hale <dhale@caltech.edu> or
44+
# Stephen Kaye <skaye@caltech.edu>
45+
46+
# -----------------------------------------------------------------------------
47+
# @file Makefile
48+
# @brief Makefile for Software/wdl/demo
49+
# @author David Hale
50+
# @date 2015-xx-xx
51+
# @modified 2024-08-02 made generic for demo
52+
#
53+
# This Makefile uses the general preprocessor GPP 2.24 for macro processing.
54+
# It also requires the ini2acf.pl Perl script for creating an Archon acf file.
55+
#
56+
# -----------------------------------------------------------------------------
57+
#
58+
59+
# set to path to gpp
60+
GPP = /opt/homebrew/Cellar/gpp/2.28/bin/gpp
61+
# set to path to wdl code
62+
WDLPATH = /Users/elijah/wdl-dev/wdl
63+
# output for *.acf file
64+
ACFPATH = /Users/elijah/wdl-dev/wdlfiles/acf
65+
66+
PLOT = False # True # show waveform plots by default, True | False
67+
GFLAGS = +c "/*" "*/" +c "//" "\n" +c "\\\n" ""
68+
SEQPARSER = $(WDLPATH)/wdl/seqParserDriver.py
69+
INCPARSER = $(WDLPATH)/wdl/incParserDriver.py
70+
WDLPARSER = $(WDLPATH)/wdl/wdlParserDriver.py
71+
MODPARSER = $(WDLPATH)/wdl/modParserDriver.py
72+
WAVGEN = $(WDLPATH)/wdl/wavgenDriver.py
73+
MODEGEN = $(WDLPATH)/wdl/modegenDriver.py
74+
I2A = $(WDLPATH)/wdl/ini2acf.pl
75+
INCL = -I$(CURDIR)
76+
77+
# Global variable to store the filename
78+
FILE_NAME :=
79+
80+
SCAN_CDSFILE = cat $(FILE_NAME).conf | $(GPP) $(GFLAGS) $(INCL) | \
81+
awk -F= '{gsub(" |\t","",$$1)} $$1=="CDS_FILE"{print $$2}' | cut -d'"' -f2
82+
SCAN_MODFILE = cat $(FILE_NAME).conf | $(GPP) $(GFLAGS) $(INCL) | \
83+
awk -F= '{gsub(" |\t","",$$1)} $$1=="MODULE_FILE"{print $$2}' | cut -d'"' -f2
84+
SCAN_MODEFILE = cat $(FILE_NAME).conf | $(GPP) $(GFLAGS) $(INCL) | \
85+
awk -F= '{gsub(" |\t","",$$1)} $$1=="MODE_FILE"{print $$2}' | cut -d'"' -f2
86+
87+
F_TMP = $(FILE_NAME)_TMP
88+
89+
DEBUG ?= 0
90+
91+
ifeq ($(DEBUG), 1)
92+
debug_message = @echo "Debug: $(1)"
93+
else
94+
debug_message = @true
95+
endif
96+
97+
# Main rule for building the target
98+
%:
99+
$(eval FILE_NAME := $(@F))
100+
$(call debug_message, "Current filename: $(FILE_NAME)")
101+
@$(MAKE) generate_wdl FILE_NAME=$(@F)
102+
@$(MAKE) generate_script_states FILE_NAME=$(@F)
103+
@$(MAKE) assemble_acf FILE_NAME=$(@F)
104+
105+
# Rule for generating WDL
106+
generate_wdl:
107+
$(eval MODFILE := $(shell $(SCAN_MODFILE)))
108+
@echo "Looking for MODULE_FILE = $(MODFILE) ..."
109+
@test -f $(FILE_NAME).conf || { echo "$(FILE_NAME).conf does not exist"; exit 1; }
110+
$(call debug_message, "Found configuration file: $(FILE_NAME).conf")
111+
112+
@echo "Making $(F_TMP).wdl from $(FILE_NAME).conf ..."
113+
@cat $(FILE_NAME).conf | $(SEQPARSER) - | $(GPP) $(GFLAGS) $(INCL) | $(WDLPARSER) - > $(F_TMP).wdl
114+
$(call debug_message, "Created WDL file: $(F_TMP).wdl")
115+
116+
@echo "Making $(F_TMP).script and $(F_TMP).states from $(F_TMP).wdl ..."
117+
@test -f $(MODFILE) || { echo "$(MODFILE) does not exist"; exit 1; }
118+
$(call debug_message, "Found MODULE_FILE: $(MODFILE)")
119+
120+
@cat $(MODFILE) | $(GPP) $(GFLAGS) $(INCL) | $(MODPARSER)
121+
@test -f .modules && mv .modules $(F_TMP).modules || echo "No .modules file created"
122+
@test -f .system && mv .system $(F_TMP).system || echo "No .system file created"
123+
$(call debug_message, "Processed MODULE_FILE: $(MODFILE)")
124+
125+
@$(WAVGEN) $(F_TMP) $(PLOT) || { echo "Waveform generation failed"; exit 1; }
126+
$(call debug_message, "Finished waveform generation for $(F_TMP) with plot: $(PLOT)")
127+
128+
# Rule for generating script states
129+
generate_script_states:
130+
@echo "Assembling $(FILE_NAME).acf ..."
131+
$(eval CDSFILE := $(shell $(SCAN_CDSFILE)))
132+
$(call debug_message, "Looking for CDS_FILE = $(CDSFILE) ...")
133+
@test -f $(CDSFILE) || { echo "$(CDSFILE) does not exist"; exit 1; }
134+
$(call debug_message, "Preparing to assemble $(FILE_NAME).acf file using:")
135+
$(call debug_message, "INCPARSER: $(INCPARSER)")
136+
$(call debug_message, "CDSFILE: $(CDSFILE)")
137+
$(call debug_message, "GPP Flags: $(GFLAGS)")
138+
@echo "Assembling $(FILE_NAME).acf file ..."
139+
@cat $(FILE_NAME).conf | $(INCPARSER) - | cat - $(CDSFILE) | $(GPP) $(GFLAGS) $(INCL) | \
140+
cat - $(F_TMP).script $(F_TMP).modules $(F_TMP).states $(F_TMP).system | \
141+
$(I2A) - > $(FILE_NAME).acf
142+
143+
# Rule for assembling the ACF
144+
assemble_acf:
145+
$(eval MODEFILE := $(shell $(SCAN_MODEFILE)))
146+
@$(MODEGEN) $(MODEFILE) $(FILE_NAME).acf
147+
@if [ -d ".git" ]; then \
148+
echo "Inserting REV keyword ..."; $(WDLPATH)/insert_hash $(FILE_NAME).acf; \
149+
else \
150+
echo "Not a git archive, skipping REV keyword"; \
151+
fi
152+
@echo "Done"

src/hispecatc/hispecatc.cds

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,35 @@
11
/* -*- C -*- */
22
/** ---------------------------------------------------------------------------
3-
* @file cryoscope.cds
3+
* @file hispecatc.cds
44
* @brief CDS/Deinterlace parameters for cryoscope instrument
55
*/
66

77
#include "mod10vcpu" /* include the VCPU code for MOD10 */
88

9-
BIGBUF=_ARCHON_FRAMEBUFS
10-
FRAMEMODE=_ARCHON_FRAMEMODE
11-
LINECOUNT=_TOTAL_ROWS /* _CDS_LINES_PER_TAP */
12-
PIXELCOUNT=_MAX_XADDR /* _CDS_PIXELS_PER_TAP */
13-
RAWENABLE=_RAW_ENABLE
14-
RAWENDLINE=_RAW_ENDLINE
15-
RAWSAMPLES=_RAW_SAMPLES
16-
RAWSEL=_RAW_SELECT
17-
RAWSTARTLINE=_RAW_STARTLINE
18-
RAWSTARTPIXEL=_RAW_STARTPIXEL
19-
SAMPLEMODE=_ARCHON_SAMPLE_MODE
20-
SHP1=_FIRST_RESET_SAMPLE
21-
SHP2=_LAST_RESET_SAMPLE
22-
SHD1=_FIRST_VIDEO_SAMPLE
23-
SHD2=_LAST_VIDEO_SAMPLE
24-
TAPLINE0="AM26L,1,0" /* Out0 ->VT16 -> ADCH13 -> ADM26*/ /* H2RG -> Preamp -> SAMTEC -> Archon*/
25-
TAPLINE1="AM45R,1,0" /* Out1 ->VB1 -> ADCH20 -> ADM45*/
26-
TAPLINE2="AM28L,1,0" /* Out2 ->VB16 -> ADCH12 -> ADM28*/
27-
TAPLINE3="AM49R,1,0" /* Out3 ->VB2 -> ADCH18 -> ADM49*/
28-
TAPLINE4="AM43L,1,0" /* Out4 ->VT1 -> ADCH21 -> ADM43*/
29-
TAPLINE5="AM47R,1,0" /* Out5 ->VT2 -> ADCH19 -> ADM47*/
30-
TAPLINE6="AM30L,1,0" /* Out6 ->VT15 -> ADCH11 -> ADM30*/
31-
TAPLINE7="AM33R,1,0" /* Out7 ->VT14 -> ADCH1 -> ADM33*/
32-
TAPLINE8="AM32L,1,0" /* Out8 ->VB15 -> ADCH10 -> ADM32*/
33-
TAPLINE9="AM48R,1,0" /* Out9 ->VT11 -> ADCH27 -> ADM48*/
34-
TAPLINE10="AM23L,1,0" /* Out10 ->VB13 -> ADCH6 -> ADM23*/
35-
TAPLINE11="AM40R,1,0" /* Out11 ->VT4 -> ADCH31 -> ADM40*/
36-
TAPLINE12="AM35L,1,0" /* Out12 ->VB14 -> ADCH0 -> ADM35*/
37-
TAPLINE13="AM27R,1,0" /* Out13 ->VB5 -> ADCH4 -> ADM27*/
38-
TAPLINE14="AM44L,1,0" /* Out14 ->VT12 -> ADCH29 -> ADM44*/
39-
TAPLINE15="AM22R,1,0" /* Out15 ->VT8 -> ADCH15 -> ADM22*/
40-
TAPLINE16="AM50L,1,0" /* Out16 ->VB11 -> ADCH26 -> ADM50*/
41-
TAPLINE17="AM31R,1,0" /* Out17 ->VB6 -> ADCH2 -> ADM31*/
42-
TAPLINE18="AM53L,1,0" /* Out18 ->VB10 -> ADCH16 -> ADM53*/
43-
TAPLINE19="AM25R,1,0" /* Out19 ->VT5 -> ADCH5 -> ADM25*/
44-
TAPLINE20="AM41L,1,0" /* Out20 ->VB9 -> ADCH22 -> ADM41*/
45-
TAPLINE21="AM34R,1,0" /* Out21 ->VT7 -> ADCH9 -> ADM34*/
46-
TAPLINE22="AM39L,1,0" /* Out22 ->VB9 -> ADCH23 -> ADM39*/
47-
TAPLINE23="AM21R,1,0" /* Out23 ->VT13 -> ADCH7 -> ADM21*/
48-
TAPLINE24="AM46L,1,0" /* Out24 ->VB12 -> ADCH28 -> ADM46*/
49-
TAPLINE25="AM54R,1,0" /* Out25 ->VB3 -> ADCH24 -> ADM54*/
50-
TAPLINE26="AM36L,1,0" /* Out26 ->VB7 -> ADCH8 -> ADM36*/
51-
TAPLINE27="AM51R,1,0" /* Out27 ->VT10 -> ADCH17 -> ADM51*/
52-
TAPLINE28="AM52L,1,0" /* Out28 ->VT3 -> ADCH25 -> ADM52*/
53-
TAPLINE29="AM29R,1,0" /* Out29 ->VT6 -> ADCH3 -> ADM29*/
54-
TAPLINE30="AM42L,1,0" /* Out30 ->VB4 -> ADCH30 -> ADM42*/
55-
TAPLINE31="AM24R,1,0" /* Out31 ->VB8 -> ADCH14 -> ADM24*/
56-
TAPLINE32="AM37L,1,0" /* Ref Output */
57-
TAPLINES=33
9+
BIGBUF=0
10+
FRAMEMODE=1
11+
LINECOUNT=2048 /* _CDS_LINES_PER_TAP */
12+
PIXELCOUNT=1024 /* _CDS_PIXELS_PER_TAP */
13+
RAWENABLE=0
14+
RAWENDLINE=10
15+
RAWSAMPLES=25600
16+
RAWSEL=15
17+
RAWSTARTLINE=0
18+
RAWSTARTPIXEL=0
19+
SAMPLEMODE=0
20+
SHD1=700
21+
SHD2=700
22+
SHP1=256
23+
SHP2=692
24+
TAPLINE0="AM54L,1,0"
25+
TAPLINE1="AM25R,1,0"
26+
TAPLINE2="AM29L,1,0"
27+
TAPLINE3="AM31R,1,0"
28+
TAPLINE4="AM52L,1,0"
29+
TAPLINES=5
30+
TRIGINEDGE=0
31+
TRIGINENABLE=0
32+
TRIGININVERT=0
5833
TRIGOUTFORCE=0
5934
TRIGOUTINVERT=0
6035
TRIGOUTLEVEL=0

src/hispecatc/hispecatc.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** ---------------------------------------------------------------------------
22
* @file cryoscope.conf
33
* @brief WDL configuration file for Cryoscope project
4-
* @author Timothee Greffe
5-
* @date 2020-12-21 (created)
4+
* @author Elijah Anakalea-Buckley
5+
* @date 2026-04-02 (created)
66
* @modified
77
*
88
* This file needs to identify the following four files:

src/hispecatc/hispecatc.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/** -*- C -*- **/
22

33
/* Nominal values for the biases */
4-
#define V_BiasGate 2.3
5-
#define V_BiasPower 3.3
4+
#define V_BiasGate 1.2
5+
#define V_BiasPower 2.5
66
#define V_DSub 0.55
77
#define V_VDD 3.3
88
#define V_VReset 0.3
99
#define V_VDDA 3.3
10-
#define V_VRef 2.9
10+
#define V_VRef 2.57
1111
#define V_CLK_EN 3.3
12-
#define V_Preamp_EN 2.0
13-
#define V_VideoPullUp 3.3
12+
#define V_Preamp_EN 4.5
13+
#define V_VideoPullUp 3.2
1414
#define VSPARE 0.0 /* */
1515

1616
SLOT 10 lvxbias { /* slot 10 with cryoscope*/

0 commit comments

Comments
 (0)