module: cap_and_switch_array_5bit
description: 
parameters:  double unit_cap
// To be consistent with normal cppsim code modules, bussed signals must be of type 'bool'
// However, note that for electrical_element: modules, all input and output signals
// (including 'bool') will be effectively turned into type 'double' (or 'double_interp') 
// as these elements are placed at the next higher level in the hierarchy
inputs:  double vref, double vss
             bool sw_ref[4:0], bool sw_gnd[4:0]
outputs:  double tcap
classes:  
static_variables:  
init:  

end:  
code:  


electrical_element:  
capacitor tcap n0 capacitance=unit_cap
capacitor tcap n1 capacitance=unit_cap
capacitor tcap n2 capacitance=2.0*unit_cap
capacitor tcap n3 capacitance=4.0*unit_cap
capacitor tcap n4 capacitance=8.0*unit_cap
electrical_switch n0 vref sw_ref[0] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n1 vref sw_ref[1] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n2 vref sw_ref[2] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n3 vref sw_ref[3] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n4 vref sw_ref[4] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n0 vss sw_gnd[0] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n1 vss sw_gnd[1] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n2 vss sw_gnd[2] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n3 vss sw_gnd[3] on_resistance=1e3 off_resistance=100e9 noise_enable=0
electrical_switch n4 vss sw_gnd[4] on_resistance=1e3 off_resistance=100e9 noise_enable=0