diff --git a/axi/axi-stream/rtl/AxiStreamRingBuffer.vhd b/axi/axi-stream/rtl/AxiStreamRingBuffer.vhd index c9679fe392..3e6d75988a 100644 --- a/axi/axi-stream/rtl/AxiStreamRingBuffer.vhd +++ b/axi/axi-stream/rtl/AxiStreamRingBuffer.vhd @@ -152,11 +152,26 @@ architecture rtl of AxiStreamRingBuffer is signal firstAddr : slv(RAM_ADDR_WIDTH_G-1 downto 0); signal bufferLength : slv(RAM_ADDR_WIDTH_G-1 downto 0); - signal readReq : sl; - signal armed : sl; + signal readReq : sl; + signal armed : sl; + signal fifoRst : sl; + signal axilRstSync : sl; + signal dataRstSync : sl; signal txSlave : AxiStreamSlaveType; + -- attribute dont_touch : string; + -- attribute dont_touch of dataR : signal is "TRUE"; + -- attribute dont_touch of softTrigSync : signal is "TRUE"; + -- attribute dont_touch of bufferClearSync : signal is "TRUE"; + -- attribute dont_touch of axilR : signal is "TRUE"; + -- attribute dont_touch of readReq : signal is "TRUE"; + -- attribute dont_touch of armed : signal is "TRUE"; + -- attribute dont_touch of fifoRst : signal is "TRUE"; + -- attribute dont_touch of axilRstSync : signal is "TRUE"; + -- attribute dont_touch of dataRstSync : signal is "TRUE"; + -- attribute dont_touch of txSlave : signal is "TRUE"; + begin ---------------------- @@ -179,7 +194,6 @@ begin dina => dataR.ramWrData, -- Port B clkb => axilClk, - rstb => axilRst, addrb => axilR.ramRdAddr, doutb => ramRdData); end generate; @@ -201,7 +215,6 @@ begin dina => dataR.ramWrData, -- Port B clkb => axilClk, - rstb => axilRst, addrb => axilR.ramRdAddr, doutb => ramRdData); end generate; @@ -223,7 +236,6 @@ begin dina => dataR.ramWrData, -- Port B clkb => axilClk, - rstb => axilRst, addrb => axilR.ramRdAddr, doutb => ramRdData); end generate; @@ -233,22 +245,28 @@ begin -------------------------------------------------- U_SyncVec_dataClk : entity surf.SynchronizerVector generic map ( - TPD_G => TPD_G, - RST_ASYNC_G => RST_ASYNC_G, - WIDTH_G => 2) + TPD_G => TPD_G, + WIDTH_G => 2) port map ( clk => dataClk, - rst => dataRst, dataIn(0) => axilR.softTrig, dataIn(1) => axilR.bufferClear, dataOut(0) => softTrigSync, dataOut(1) => bufferClearSync); + U_RstSync_axilRst : entity surf.RstSync + generic map ( + TPD_G => TPD_G) + port map ( + clk => dataClk, + asyncRst => axilRst, + syncRst => axilRstSync); + -------------------------- -- Main AXI-Stream process -------------------------- - dataComb : process (bufferClearSync, dataR, dataRst, dataValid, dataValue, - extTrig, softTrigSync) is + dataComb : process (axilRstSync, bufferClearSync, dataR, dataRst, dataValid, + dataValue, extTrig, softTrigSync) is variable v : DataRegType; begin -- Latch the current value @@ -297,7 +315,7 @@ begin end if; -- Synchronous Reset - if (RST_ASYNC_G = false and dataRst = '1') or (bufferClearSync = '1') then + if (RST_ASYNC_G = false and dataRst = '1') or (bufferClearSync = '1') or (axilRstSync = '1') then v := DATA_REG_INIT_C; end if; @@ -324,7 +342,7 @@ begin RST_ASYNC_G => RST_ASYNC_G, DATA_WIDTH_G => 2*RAM_ADDR_WIDTH_G) port map ( - rst => axilRst, + rst => fifoRst, -- Write Interface wr_clk => dataClk, wr_en => dataR.readReq, @@ -334,6 +352,8 @@ begin valid => readReq, dout => fifoDout); + fifoRst <= dataRst or axilRst; + fifoDin(1*RAM_ADDR_WIDTH_G-1 downto 0*RAM_ADDR_WIDTH_G) <= dataR.firstAddr; fifoDin(2*RAM_ADDR_WIDTH_G-1 downto 1*RAM_ADDR_WIDTH_G) <= dataR.bufferLength; @@ -342,29 +362,33 @@ begin U_SyncVec_axilClk : entity surf.SynchronizerVector generic map ( - TPD_G => TPD_G, - RST_ASYNC_G => RST_ASYNC_G, - WIDTH_G => 1) + TPD_G => TPD_G, + WIDTH_G => 1) port map ( clk => axilClk, - rst => axilRst, dataIn(0) => dataR.armed, dataOut(0) => armed); + U_RstSync_dataRst : entity surf.RstSync + generic map ( + TPD_G => TPD_G) + port map ( + clk => axilClk, + asyncRst => dataRst, + syncRst => dataRstSync); + ------------------------ -- Main AXI-Lite process ------------------------ axiComb : process (armed, axilR, axilReadMaster, axilRst, axilWriteMaster, - bufferLength, firstAddr, ramRdData, readReq, txSlave) is + bufferLength, dataRstSync, firstAddr, ramRdData, readReq, + txSlave) is variable v : AxilRegType; variable axilEp : AxiLiteEndpointType; begin -- Latch the current value v := axilR; - -- Reset strobe - v.bufferClear := '0'; - ------------------------ -- AXI-Lite Transactions ------------------------ @@ -486,13 +510,28 @@ begin -- Check if armed de-asserted if (armed = '0') then + + -- Reset the flag + v.bufferClear := '0'; + -- Next states v.dataState := IDLE_S; v.trigState := IDLE_S; + end if; ---------------------------------------------------------------------- end case; + -- Check for external data reset + if (dataRstSync = '1') then + -- Reset the flags + v.bufferClear := '0'; + v.softTrig := '0'; + -- Next states + v.dataState := IDLE_S; + v.trigState := IDLE_S; + end if; + -- Update RAM read address v.ramRdAddr := firstAddr + v.wordCnt; diff --git a/python/surf/devices/linear/_Ltc3815.py b/python/surf/devices/linear/_Ltc3815.py new file mode 100644 index 0000000000..6fd972bb31 --- /dev/null +++ b/python/surf/devices/linear/_Ltc3815.py @@ -0,0 +1,100 @@ +#----------------------------------------------------------------------------- +# This file is part of the 'SLAC Firmware Standard Library'. It is subject to +# the license terms in the LICENSE.txt file found in the top-level directory +# of this distribution and at: +# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. +# No part of the 'SLAC Firmware Standard Library', including this file, may be +# copied, modified, propagated, or distributed except according to the terms +# contained in the LICENSE.txt file. +#----------------------------------------------------------------------------- + +import pyrogue as pr + +import surf.protocols.i2c + +class Ltc3815(surf.protocols.i2c.PMBus): + def __init__(self, **kwargs): + super().__init__(**kwargs) + + self.add(pr.LinkVariable( + name = 'Vin', + mode = 'RO', + units = 'V', + typeStr = "Float32", + disp = '{:1.3f}', + linkedGet = lambda read: self.READ_VIN.get(read=read)*4.0E-3, # Conversion factor: 4mV/Bit + dependencies = [self.READ_VIN], + )) + + self.add(pr.LinkVariable( + name = 'Iin', + mode = 'RO', + units = 'A', + typeStr = "Float32", + disp = '{:1.3f}', + linkedGet = lambda read: self.READ_IIN.get(read=read)*10.0E-3, # Conversion factor: 10mA/Bit + dependencies = [self.READ_IIN], + )) + + self.add(pr.LinkVariable( + name = 'Vout', + mode = 'RO', + units = 'V', + typeStr = "Float32", + disp = '{:1.3f}', + linkedGet = lambda read: self.READ_VOUT.get(read=read)*0.5E-3, # Conversion factor: 0.5mV/Bit + dependencies = [self.READ_VOUT], + )) + + self.add(pr.LinkVariable( + name = 'Iout', + mode = 'RO', + units = 'A', + typeStr = "Float32", + disp = '{:1.3f}', + linkedGet = lambda read: self.READ_IOUT.get(read=read)*10.0E-3, # Conversion factor: 10mA/Bit + dependencies = [self.READ_IOUT], + )) + + self.add(pr.LinkVariable( + name = "DieTempature", + mode = 'RO', + linkedGet = lambda read: self.READ_TEMPERATURE_1.get(read=read)*1.0, # Conversion factor: 1 degC/Bit + typeStr = "Float32", + disp = '{:1.3f}', + units = 'degC', + dependencies = [self.READ_TEMPERATURE_1], + )) + + self.add(pr.LinkVariable( + name = 'Pin', + description = 'Power Measurement', + mode = 'RO', + linkedGet = lambda read: (self.Vin.get(read=read))*(self.Iin.get(read=read)), + typeStr = "Float32", + disp = '{:1.3f}', + units = 'W', + dependencies = [self.Vin,self.Iin], + )) + + self.add(pr.LinkVariable( + name = 'Pout', + description = 'Power Measurement', + mode = 'RO', + linkedGet = lambda read: (self.Vout.get(read=read))*(self.Iout.get(read=read)), + typeStr = "Float32", + disp = '{:1.3f}', + units = 'W', + dependencies = [self.Vout,self.Iout], + )) + + self.add(pr.LinkVariable( + name = 'Peff', + description = 'Power Conversion Efficiency', + mode = 'RO', + linkedGet = lambda read: 100.0*(self.Pout.get(read=read))/(self.Pin.get(read=read)) if self.Pin.get(read=read)>0.0 else 0.0, + typeStr = "Float32", + disp = '{:1.1f}', + units = '%', + dependencies = [self.Pin,self.Pout], + )) diff --git a/python/surf/devices/linear/_Ltc4151.py b/python/surf/devices/linear/_Ltc4151.py index e14d9748df..e17651bf8b 100644 --- a/python/surf/devices/linear/_Ltc4151.py +++ b/python/surf/devices/linear/_Ltc4151.py @@ -56,7 +56,7 @@ def __init__(self, units = 'A', disp = '{:1.3f}', dependencies = [self.SenseMsb,self.SenseLsb], - linkedGet = lambda: (int(self.SenseMsb.value()<<4)|int(self.SenseLsb.value()&0xF))*20.0E-6/self.senseRes + linkedGet = lambda read: (int(self.SenseMsb.get(read=read)<<4)|int(self.SenseLsb.get(read=read)&0xF))*20.0E-6/self.senseRes )) self.add(pr.RemoteVariable( @@ -90,7 +90,7 @@ def __init__(self, units = 'V', disp = '{:1.3f}', dependencies = [self.VinMsb,self.VinLsb], - linkedGet = lambda: (int(self.VinMsb.value()<<4)|int(self.VinLsb.value()&0xF))*25.0E-3 + linkedGet = lambda read: (int(self.VinMsb.get(read=read)<<4)|int(self.VinLsb.get(read=read)&0xF))*25.0E-3 )) self.add(pr.LinkVariable( @@ -100,7 +100,7 @@ def __init__(self, units = 'W', disp = '{:1.3f}', dependencies = [self.Vin,self.Iin], - linkedGet = lambda: (self.Vin.value())*(self.Iin.value()) + linkedGet = lambda read: (self.Vin.get(read=read))*(self.Iin.get(read=read)) )) self.add(pr.RemoteVariable( @@ -134,7 +134,7 @@ def __init__(self, units = 'V', disp = '{:1.3f}', dependencies = [self.AdinMsb,self.AdinLsb], - linkedGet = lambda: (int(self.AdinMsb.value()<<4)|int(self.AdinLsb.value()&0xF))*500.0E-6 + linkedGet = lambda read: (int(self.AdinMsb.get(read=read)<<4)|int(self.AdinLsb.get(read=read)&0xF))*500.0E-6 )) self.add(pr.RemoteVariable( diff --git a/python/surf/devices/linear/__init__.py b/python/surf/devices/linear/__init__.py index 49c0fa9f5e..1e300f3edc 100644 --- a/python/surf/devices/linear/__init__.py +++ b/python/surf/devices/linear/__init__.py @@ -9,4 +9,5 @@ ############################################################################## from surf.devices.linear._Ltc2270 import * from surf.devices.linear._Ltc2945 import * +from surf.devices.linear._Ltc3815 import * from surf.devices.linear._Ltc4151 import * diff --git a/python/surf/devices/micron/_AxiMicronMt28ew.py b/python/surf/devices/micron/_AxiMicronMt28ew.py index 3df2ff3a91..281debcf0c 100644 --- a/python/surf/devices/micron/_AxiMicronMt28ew.py +++ b/python/surf/devices/micron/_AxiMicronMt28ew.py @@ -118,6 +118,7 @@ def __init__(self, bulkOpEn = False, hidden = True, verify = False, + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) self.add(pr.LocalCommand( diff --git a/python/surf/devices/micron/_AxiMicronN25Q.py b/python/surf/devices/micron/_AxiMicronN25Q.py index 56483f3ec0..113a340884 100644 --- a/python/surf/devices/micron/_AxiMicronN25Q.py +++ b/python/surf/devices/micron/_AxiMicronN25Q.py @@ -107,6 +107,7 @@ def __init__(self, bulkOpEn = False, hidden = True, verify = False, + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) ############################## diff --git a/python/surf/devices/micron/_AxiMicronP30.py b/python/surf/devices/micron/_AxiMicronP30.py index ee7a9866d3..e4836f850a 100644 --- a/python/surf/devices/micron/_AxiMicronP30.py +++ b/python/surf/devices/micron/_AxiMicronP30.py @@ -118,6 +118,7 @@ def __init__(self, bulkOpEn = False, hidden = True, verify = False, + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) self.add(pr.LocalCommand( diff --git a/python/surf/devices/nxp/_Sa56004x.py b/python/surf/devices/nxp/_Sa56004x.py index 38dd8987ca..1b56f3e6a1 100644 --- a/python/surf/devices/nxp/_Sa56004x.py +++ b/python/surf/devices/nxp/_Sa56004x.py @@ -18,9 +18,14 @@ class Sa56004x(pr.Device): def __init__(self, pollInterval = 1, + simpleViewList = ['enable', 'LocalTemperature', 'RemoteTemperature', 'RemoteTcritSetpoint'], **kwargs): super().__init__(**kwargs) + if simpleViewList is not None: + self.simpleViewList = simpleViewList[:] + self.simpleViewList.append('enable') + ############################################################################ def getTempReg(var): @@ -560,5 +565,5 @@ def simpleView(self): # Hide all the variable self.hideVariables(hidden=True) # Then unhide the most interesting ones - vars = ['enable', 'LocalTemperature', 'RemoteTemperature'] + vars = self.simpleViewList self.hideVariables(hidden=False, variables=vars) diff --git a/python/surf/devices/silabs/_Si5324.py b/python/surf/devices/silabs/_Si5324.py index aa5aaabffc..3d1b9d8a8e 100644 --- a/python/surf/devices/silabs/_Si5324.py +++ b/python/surf/devices/silabs/_Si5324.py @@ -32,6 +32,7 @@ def __init__(self,**kwargs): hidden = True, base = pr.UInt, mode = "RW", + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) self.add(pr.LocalVariable( diff --git a/python/surf/devices/silabs/_Si5326.py b/python/surf/devices/silabs/_Si5326.py index 3346368383..d4567c0dd2 100644 --- a/python/surf/devices/silabs/_Si5326.py +++ b/python/surf/devices/silabs/_Si5326.py @@ -32,6 +32,7 @@ def __init__(self,**kwargs): hidden = True, base = pr.UInt, mode = "RW", + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) self.add(pr.LocalVariable( diff --git a/python/surf/devices/silabs/_Si5345Pages.py b/python/surf/devices/silabs/_Si5345Pages.py index 0f42be879e..75f948f3e5 100644 --- a/python/surf/devices/silabs/_Si5345Pages.py +++ b/python/surf/devices/silabs/_Si5345Pages.py @@ -37,6 +37,7 @@ def __init__(self, hidden = True, base = pr.UInt, mode = "RW", + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) def MyLinkVariable(self, name, description, offset, bitSize, mode, bitOffset=0, pollInterval=0, value=None, hidden=False): diff --git a/python/surf/devices/ti/_Ina237.py b/python/surf/devices/ti/_Ina237.py new file mode 100644 index 0000000000..8e90e2de98 --- /dev/null +++ b/python/surf/devices/ti/_Ina237.py @@ -0,0 +1,249 @@ +#----------------------------------------------------------------------------- +# This file is part of 'SLAC Firmware Standard Library'. +# It is subject to the license terms in the LICENSE.txt file found in the +# top-level directory of this distribution and at: +# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. +# No part of 'SLAC Firmware Standard Library', including this file, +# may be copied, modified, propagated, or distributed except according to +# the terms contained in the LICENSE.txt file. +#----------------------------------------------------------------------------- + +import pyrogue as pr + +class Ina237(pr.Device): + def __init__(self, + pollInterval = 1, + senseRes = 20.E-3, # Units of Ohms + hideConfig = True, + **kwargs): + + super().__init__(**kwargs) + + self.add(pr.LocalVariable( + name = 'SenseRes', + mode = 'RW', + value = senseRes, + hidden = hideConfig, + )) + + ############## + # 0h CONFIG + ############## + + self.add(pr.RemoteCommand( + name = 'RST', + description = 'Reset Bit. Setting this bit to 1 generates a system reset that is the same as power-on reset.', + offset = (0x0 << 2), + bitSize = 1, + bitOffset = 15, + function = lambda cmd: (cmd.post(1), self.readBlocks(checkEach=True))[0], + hidden = hideConfig, + )) + + self.add(pr.RemoteVariable( + name = 'CONVDLY', + description = 'Sets the Delay for initial ADC conversion in steps of 2 ms.', + offset = (0x0 << 2), + bitSize = 8, + bitOffset = 6, + mode = 'RW', + units = '2ms', + hidden = hideConfig, + )) + + self.add(pr.RemoteVariable( + name = 'ADCRANGE', + description = 'Reset Bit. Setting this bit to 1 generates a system reset that is the same as power-on reset.', + offset = (0x0 << 2), + bitSize = 1, + bitOffset = 4, + mode = 'RW', + enum = { + 0 : '+/-163.84mV', + 1 : '+/-40.96mV', + }, + hidden = hideConfig, + )) + + ############## + # 1h ADC_CONFIG + ############## + + self.add(pr.RemoteVariable( + name = 'MODE', + description = 'The user can set the MODE bits for continuous or triggered mode on bus voltage, shunt voltage or temperature measurement.', + offset = (0x1 << 2), + bitSize = 4, + bitOffset = 12, + mode = 'RW', + hidden = hideConfig, + )) + + self.add(pr.RemoteVariable( + name = 'VBUSCT', + description = 'Sets the conversion time of the bus voltage measurement', + offset = (0x1 << 2), + bitSize = 3, + bitOffset = 9, + mode = 'RW', + hidden = hideConfig, + )) + + self.add(pr.RemoteVariable( + name = 'VSHCT', + description = 'Sets the conversion time of the shunt voltage measurement', + offset = (0x1 << 2), + bitSize = 3, + bitOffset = 6, + mode = 'RW', + hidden = hideConfig, + )) + + self.add(pr.RemoteVariable( + name = 'VTCT', + description = 'Sets the conversion time of the temperature measurement', + offset = (0x1 << 2), + bitSize = 3, + bitOffset = 3, + mode = 'RW', + hidden = hideConfig, + )) + + self.add(pr.RemoteVariable( + name = 'AVG', + description = 'Selects ADC sample averaging count. The averaging setting applies to all active inputs', + offset = (0x1 << 2), + bitSize = 3, + bitOffset = 0, + mode = 'RW', + hidden = hideConfig, + )) + + ############## + # 2h SHUNT_CAL + ############## + + self.add(pr.RemoteVariable( + name = 'SHUNT_CAL', + description = 'The register provides the device with a conversion constant value that represents shunt resistance used to calculate current value in Amperes', + offset = (0x2 << 2), + bitSize = 15, + bitOffset = 0, + mode = 'RW', + hidden = hideConfig, + )) + + + ############## + # 4h VSHUNT + ############## + + self.add(pr.RemoteVariable( + name = 'VSHUNT', + description = 'Differential voltage measured across the shunt output. Twos complement value', + offset = (0x4 << 2), + bitSize = 16, + bitOffset = 0, + base = pr.Int, + mode = 'RO', + pollInterval = pollInterval, + hidden = hideConfig, + )) + + ############## + # 5h VBUS + ############## + + self.add(pr.RemoteVariable( + name = 'VBUS', + description = 'Bus voltage output. Twos complement value, however always positive', + offset = (0x5 << 2), + bitSize = 16, + bitOffset = 0, + base = pr.Int, + mode = 'RO', + pollInterval = pollInterval, + hidden = hideConfig, + )) + + ############## + # 6h DIETEMP + ############## + + self.add(pr.RemoteVariable( + name = 'DIETEMP', + description = 'Internal die temperature measurement. Twos complement value', + offset = (0x6 << 2), + bitSize = 12, + bitOffset = 4, + base = pr.Int, + mode = 'RO', + pollInterval = pollInterval, + hidden = hideConfig, + )) + + ############################################################################### + + self.add(pr.RemoteVariable( + name = 'MANFID', + description = 'Reads back TI in ASCII (should be 0x5449)', + offset = (0x3E << 2), + bitSize = 16, + bitOffset = 0, + mode = 'RO', + )) + + ############################################################################### + + self.add(pr.LinkVariable( + name = 'Vin', + description = 'Voltage Measurement', + mode = 'RO', + linkedGet = lambda read: self.VBUS.get(read=read)*3.125E-3, # Conversion factor: 3.125 mV/LSB + typeStr = "Float32", + disp = '{:1.3f}', + units = 'V', + dependencies = [self.VBUS], + )) + + self.add(pr.LinkVariable( + name = 'Iin', + description = 'Current Measurement', + mode = 'RO', + linkedGet = self.convCurrent, + typeStr = "Float32", + disp = '{:1.3f}', + units = 'A', + dependencies = [self.ADCRANGE,self.VSHUNT,self.SenseRes], + )) + + self.add(pr.LinkVariable( + name = 'Pin', + description = 'Power Measurement', + mode = 'RO', + linkedGet = lambda read: (self.Vin.get(read=read))*(self.Iin.get(read=read)), + typeStr = "Float32", + disp = '{:1.3f}', + units = 'W', + dependencies = [self.Vin,self.Iin], + )) + + self.add(pr.LinkVariable( + name = "DieTempature", + mode = 'RO', + linkedGet = lambda read: self.DIETEMP.get(read=read)*0.125, # Conversion factor: 0.125 degC/LSB + typeStr = "Float32", + disp = '{:1.3f}', + units = 'degC', + dependencies = [self.DIETEMP], + )) + + def convCurrent(self, read): # Don't need dev and var since not used + adcRange = self.ADCRANGE.value() # Doesn't change in HW so shadow value is preferred + if adcRange == 0: + lsbScale = 5.0E-6 # 5 uV/LSB + else: + lsbScale = 1.23E-6 # 1.25 uV/LSB + value = self.VSHUNT.get(read=read) # Read the ADC value + fpValue = value*lsbScale + return (fpValue/self.SenseRes.value()) # SenseRes is LocalVariable diff --git a/python/surf/devices/ti/_Lmx2594.py b/python/surf/devices/ti/_Lmx2594.py index 212f4a1b17..8355dab6bf 100644 --- a/python/surf/devices/ti/_Lmx2594.py +++ b/python/surf/devices/ti/_Lmx2594.py @@ -32,6 +32,7 @@ def __init__(self, **kwargs): hidden = True, base = pr.UInt, mode = "RW", + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) def addLinkVariable(name, description, offset, bitSize, mode, bitOffset=0, pollInterval=0, value=None, hidden=False): diff --git a/python/surf/devices/ti/_Lmx2615.py b/python/surf/devices/ti/_Lmx2615.py index c1b38e74cf..2be4ec2988 100644 --- a/python/surf/devices/ti/_Lmx2615.py +++ b/python/surf/devices/ti/_Lmx2615.py @@ -35,6 +35,7 @@ def __init__(self, **kwargs): hidden = True, base = pr.UInt, mode = "RW", + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) self.add(pr.RemoteVariable( diff --git a/python/surf/devices/ti/__init__.py b/python/surf/devices/ti/__init__.py index 338df84b95..2c4edf8a30 100644 --- a/python/surf/devices/ti/__init__.py +++ b/python/surf/devices/ti/__init__.py @@ -16,6 +16,7 @@ from surf.devices.ti._AxiCdcm6208 import * from surf.devices.ti._Dac38J84 import * from surf.devices.ti._Ds32Ev400 import * +from surf.devices.ti._Ina237 import * from surf.devices.ti._Lmk048Base import * from surf.devices.ti._Lmk04828 import * from surf.devices.ti._Lmk04832 import * diff --git a/python/surf/protocols/i2c/_PMBus.py b/python/surf/protocols/i2c/_PMBus.py index 25cb807283..98b50181a2 100644 --- a/python/surf/protocols/i2c/_PMBus.py +++ b/python/surf/protocols/i2c/_PMBus.py @@ -11,7 +11,7 @@ import pyrogue as pr class PMBus(pr.Device): - def __init__(self, simpleDisplay = True, **kwargs): + def __init__(self, simpleDisplay = True, dynamicAddr=False, **kwargs): super().__init__(**kwargs) self.add(pr.RemoteVariable( @@ -19,7 +19,8 @@ def __init__(self, simpleDisplay = True, **kwargs): offset = 0x400, bitSize = 10, bitOffset = 0, - mode = 'RW', + mode = 'RW' if dynamicAddr else 'RO', + hidden = simpleDisplay, )) self.add(pr.RemoteVariable( @@ -27,7 +28,8 @@ def __init__(self, simpleDisplay = True, **kwargs): offset = 0x400, bitSize = 1, bitOffset = 10, - mode = 'RW', + mode = 'RW' if dynamicAddr else 'RO', + hidden = simpleDisplay, )) self.add(pr.RemoteVariable( @@ -44,6 +46,7 @@ def __init__(self, simpleDisplay = True, **kwargs): offset = (4*0x00), bitSize = 8, mode = 'RW', + hidden = simpleDisplay, )) self.add(pr.RemoteVariable( diff --git a/python/surf/protocols/sugoi/_SugoiAxiLitePixelMatrixConfig.py b/python/surf/protocols/sugoi/_SugoiAxiLitePixelMatrixConfig.py index 1bdfea1331..b76b76e354 100644 --- a/python/surf/protocols/sugoi/_SugoiAxiLitePixelMatrixConfig.py +++ b/python/surf/protocols/sugoi/_SugoiAxiLitePixelMatrixConfig.py @@ -131,6 +131,7 @@ def __init__(self, hidden = True, base = pr.UInt, mode = "RW", + groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML )) self.add(pr.RemoteVariable(