Ejemplo n.º 1
0
 def process(self, data, jp):
     net_name = data['DCB slot'] + '_' + jp + '_' + data['Signal ID']
     return (
         NetNode(DCB=data['DCB slot'], DCB_PIN=data['SEAM pin'],
                 PT=jp, PT_PIN=data['Pigtail pin']
                 ),
         self.prop_gen(net_name, data['Note']))
Ejemplo n.º 2
0
 def process(self, data, jd):
     net_name = jd + '_' + data['Pigtail slot'] + '_' + data['Signal ID']
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin'],
                 PT=data['Pigtail slot'], PT_PIN=data['Pigtail pin']
                 ),
         self.prop_gen(net_name))
Ejemplo n.º 3
0
 def test_multiple_nodes(self):
     nodes_dict = {
         NetNode('JD1', 'A1'): {
             'NETNAME': 'JD1_JPL1_unreal',
             'ATTR': None
         },
         NetNode('JD2', 'A2', 'JP1', 'A1'): {
             'NETNAME': 'JD2_JP1_unreal',
             'ATTR': None
         },
     }
     self.assertEqual(
         dict(netnode_to_netlist(nodes_dict)), {
             'JD1_JPL1_unreal': [('JD1', 'A1')],
             'JD2_JP1_unreal': [('JD2', 'A2'), ('JP1', 'A1')],
         })
Ejemplo n.º 4
0
 def process(self, data, jd):
     if 'SEC_DIN' in data['Signal ID'] or 'EC_SEC_CLK' in data['Signal ID']:
         net_name = jd + '_SEC_ELK_' + data['Signal ID'][-1]
     else:
         net_name = jd + '_ELK_' + data['Signal ID'][-1]
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin']),
         self.prop_gen(net_name, attr='_FRO_'))
Ejemplo n.º 5
0
 def test_dcb_pt_node(self):
     nodes_dict = {
         NetNode('JD1', 'A1', 'JP1', 'A1'): {
             'NETNAME': 'JD1_JP1_unreal',
             'ATTR': None
         }
     }
     self.assertEqual(dict(netnode_to_netlist(nodes_dict)),
                      {'JD1_JP1_unreal': [('JD1', 'A1'), ('JP1', 'A1')]})
Ejemplo n.º 6
0
 def process(self, data, jd):
     net_name = jd + '_' + 'AGND'
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin'],
                 PT=data['Pigtail slot'] if data['Pigtail slot'] is not None
                 else None,
                 PT_PIN=data['Pigtail pin'] if data['Pigtail pin'] is not
                 None else None
                 ),
         self.prop_gen(net_name))
Ejemplo n.º 7
0
 def test_with_dummy(self):
     self.maxDiff = None
     dataset = {0: (1, 2, 3), 1: (1, 2)}
     rule = RulePDDummy()
     selector = SelectorPD(dataset, [rule])
     result = selector.do()
     self.assertEqual(
         result, {
             NetNode(1, 1): {
                 'NETNAME': 1,
                 'NOTE': None,
                 'ATTR': None
             },
             NetNode(1, 2): {
                 'NETNAME': 2,
                 'NOTE': None,
                 'ATTR': None
             },
         })
Ejemplo n.º 8
0
 def process(self, data, jp):
     dcb_name, tail = data['Signal ID'].split('_', 1)
     if 'EC_ADC' in data['Signal ID']:
         # Becuase EC_ADC connects to Thermistor, add prefix THERM
         net_name = dcb_name + '_' + jp + '_THERM_' + tail
     else:
         net_name = dcb_name + '_' + jp + '_' + tail
     return (
         NetNode(PT=jp, PT_PIN=data['Pigtail pin'],
                 DCB=data['DCB slot'], DCB_PIN=data['SEAM pin']),
         self.prop_gen(net_name, data['Note']))
Ejemplo n.º 9
0
    def process(self, data, jp):
        net_name = jp + '_' + data['Signal ID']
        attr = '_FRO_'

        for rule in self.rules:
            pt_name, tail = rule.split('_', 1)
            if jp == pt_name and data['Signal ID'] in tail:
                net_name = rule
                attr = None
                break
        return (
            NetNode(PT=jp, PT_PIN=data['Pigtail pin']),
            self.prop_gen(net_name, data['Note'], attr))
Ejemplo n.º 10
0
 def process(self, data, jd):
     if 'EC_ADC' in data['Signal ID']:
         # Becuase EC_ADC connects to Thermistor, add prefix THERM
         net_name = jd + '_' + data['Pigtail slot'] + '_THERM_' \
             + data['Signal ID'] + '_P'
     else:
         net_name = jd + '_' + data['Pigtail slot'] + '_' \
             + data['Signal ID'] + '_P'
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin'],
                 PT=data['Pigtail slot'], PT_PIN=data['Pigtail pin']
                 ),
         self.prop_gen(net_name))
Ejemplo n.º 11
0
    def process(self, data, jd):
        jp = jd.replace('D', 'P')
        signal = data['Signal ID']

        if 'REF13' in signal:
            jp_pin = 'A16'
            net_name = jp + jp_pin + '_' + 'P3_LV_SENSE_GND'
        elif 'REF14' in signal:
            jp_pin = 'J24'
            net_name = jp + jp_pin + '_' + 'P1_WEST_LV_SENSE_GND'
        elif 'REF15' in signal:
            # NOTE: This is a special case, because in the netname, the pin
            # number is padded!
            jp_pin = 'F5'
            net_name = jp + 'F05' + '_' + 'P2_EAST_LV_SENSE_GND'
        else:
            raise ValueError(
                'EC_ADC_REF: {} detected but not belongs to any known case'.format(
                    signal
                ))

        return (
            NetNode(DCB=jd, DCB_PIN=data['SEAM pin'], PT=jp, PT_PIN=jp_pin),
            self.prop_gen(net_name))
Ejemplo n.º 12
0
    def test_debug(self):
        dataset = {
            NetNode('JD1', 'A1'): 1,
            NetNode('JD2', 'A1'): 1,
            NetNode('JD2', 'A3'): 1,
            NetNode('JD5', 'A6'): 1,
        }

        rule = RuleNetDummy({}, {}, {})
        rule.debug_node = NetNode('JD5', 'A6')
        selector = SelectorNet(dataset, [rule])
        result = selector.do()
        self.assertEqual(result['Test'], [
            'Node: DCB: JD1, DCB_PIN: A1, PT: None, PT_PIN: None',
            'Node: DCB: JD2, DCB_PIN: A1, PT: None, PT_PIN: None',
            'Node: DCB: JD2, DCB_PIN: A3, PT: None, PT_PIN: None',
            'Node: DCB: JD5, DCB_PIN: A6, PT: None, PT_PIN: None'
        ])
        self.assertEqual(
            rule.last_debug_msg,
            'Node ' + RuleNet.node_to_str(NetNode('JD5', 'A6')) +
            ' is being handled by: RuleNetDummy')
Ejemplo n.º 13
0
 def process(self, data, idx):
     return (NetNode(DCB=idx, DCB_PIN=data), self.prop_gen(netname=data))
Ejemplo n.º 14
0
 def test_entry_with_attr(self):
     entry = NetNode('2', '3', '4', '5')
     self.assertEqual(csv_line(entry, {
         'NETNAME': 'A_B',
         'ATTR': '_C_'
     }), 'A_C_B,2,3,4,5')
Ejemplo n.º 15
0
 def process(self, data, jp):
     return (
         NetNode(PT=jp, PT_PIN=data['Pigtail pin']),
         self.prop_gen('GND', data['Note']))
Ejemplo n.º 16
0
 def test_normal_entry(self):
     entry = NetNode(*[str(i) for i in range(1, 5)])
     self.assertEqual(csv_line(entry, self.dummy_prop), 'NET,1,2,3,4')
Ejemplo n.º 17
0
 def test_entry_with_none(self):
     entry = NetNode(*[str(i) for i in range(1, 4)], None)
     self.assertEqual(csv_line(entry, self.dummy_prop), 'NET,1,2,3,')
Ejemplo n.º 18
0
 def process(self, data, jp):
     netname = jp + '_' + self.find_jt(jp) + '_' + data['Signal ID'].replace(
         'THERMISTOR', 'THERM')
     return (
         NetNode(PT=jp, PT_PIN=data['Pigtail pin']),
         self.prop_gen(netname, data['Note']))
Ejemplo n.º 19
0
 def process(self, data, jp):
     net_name = jp + PADDING(data['Pigtail pin']) + '_' + data['Signal ID']
     return (
         NetNode(PT=jp, PT_PIN=data['Pigtail pin']),
         self.prop_gen(net_name, data['Note'], None))
Ejemplo n.º 20
0
 def process(self, data, jd):
     net_name = jd + '_' + data['Signal ID']
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin']),
         self.prop_gen(net_name, attr='_FRO_'))
Ejemplo n.º 21
0
 def process(self, data, jd):
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin']),
         self.prop_gen('GND'))
Ejemplo n.º 22
0
 def process(self, data, jd):
     # Note: here the matching nodes will have placeholder in netlist file.
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin']),
         self.prop_gen(None, attr='_PlaceHolder_'))
Ejemplo n.º 23
0
 def process(self, data, jd):
     net_name = self.netname_replacement(jd, data['Signal ID'])
     return (
         NetNode(DCB=jd, DCB_PIN=data['SEAM pin'],),
         self.prop_gen(net_name))
Ejemplo n.º 24
0
 def process(self, data, jp):
     # Note: here the matching nodes will have placeholder in netlist file.
     return (
         NetNode(PT=jp, PT_PIN=data['Pigtail pin']),
         self.prop_gen(None, data['Note'], '_PlaceHolder_'))