@@ -60,58 +60,6 @@ def __init__(self, hostname, katcp_port=7147, timeout=3,
6060 def __repr__ (self ):
6161
6262 return "<SnapBoard host: %s port: %s>" % (self .host , self .katcp_port )
63-
64- def _program (self , filename = None ):
65- """
66- Program the FPGA with the specified binary file.
67- :param filename: name of file to program, can vary depending on the formats
68- supported by the device. e.g. fpg, bof, bin
69- :return:
70- """
71-
72- if filename is None :
73- self .logger .error ('%s: cannot program with no filename given. '
74- 'Exiting.' % self .host )
75- raise RuntimeError ('Cannot program with no filename given. '
76- 'Exiting.' )
77-
78- unhandled_informs = []
79-
80- # set the unhandled informs callback
81- self .unhandled_inform_handler = \
82- lambda msg : unhandled_informs .append (msg )
83- reply , _ = self .katcprequest (name = 'progdev' , request_timeout = 10 ,
84- request_args = (filename , ))
85- self .unhandled_inform_handler = None
86- if reply .arguments [0 ] == 'ok' :
87- complete_okay = False
88- for inf in unhandled_informs :
89- if (inf .name == 'fpga' ) and (inf .arguments [0 ] == 'ready' ):
90- complete_okay = True
91- if not complete_okay : # Modify to do an extra check
92- reply , _ = self .katcprequest (name = 'status' , request_timeout = 1 )
93- # Not sure whether 1 second is a good timeout here
94- if reply .arguments [0 ] == 'ok' :
95- complete_okay = True
96- else :
97- self .logger .error ('%s: programming %s failed.' %
98- (self .host , filename ))
99- for inf in unhandled_informs :
100- LOGGER .debug (inf )
101- raise RuntimeError ('%s: programming %s failed.' %
102- (self .host , filename ))
103- self .system_info ['last_programmed' ] = filename
104- else :
105- self .logger .error ('%s: progdev request %s failed.' %
106- (self .host , filename ))
107- raise RuntimeError ('%s: progdev request %s failed.' %
108- (self .host , filename ))
109- if filename [- 3 :] == 'fpg' :
110- self .get_system_information ()
111- else :
112- self .logger .info ('%s: %s is not an fpg file, could not parse '
113- 'system information.' % (self .host , filename ))
114- self .logger .info ('%s: programmed %s okay.' % (self .host , filename ))
11563
11664 def est_brd_clk (self ):
11765 """Returns the approximate clock rate of the FPGA in MHz.
@@ -138,7 +86,7 @@ def program(self, boffile, gain=1, demux_mode=1, chips=('a', 'b', 'c')):
13886 # Make a dictionary out of chips specified on command line.
13987 # mapping chip letters to numbers to facilitate writing to adc16_controller
14088 self .logger .info ("Programming with %s - gain %i demux %i" % (boffile , gain , demux_mode ))
141- self ._program (boffile )
89+ self .transport . program (boffile )
14290
14391 if self .is_adc16_based ():
14492 self .logger .info ("Design is ADC16 based. Calibration routines will run." )
0 commit comments