Update schedule after http://jeff.tk/wiki/Trinary/Meeting_Notes_20080810
[trinary.git] / digital_simulator / Port.py
blob8dda403042683ad23f7b1e1ca080589ced06c86d
1 #!/usr/bin/python
2 # vim: set fileencoding=utf8
3 # Created:20080211
4 # By Jeff Connelly
6 IN = "in"
7 OUT = "out"
8 INOUT = "inout"
11 class Port(object):
12 def __init__(self, name, direction, type, length = 0):
13 self.name = name
14 assert direction in [IN, OUT, INOUT], \
15 "Port direction %s is invalid" % (direction,)
17 self.direction = direction
18 self.type = type
19 self.value = []
20 self.length = length
22 def __str__(self):
23 return "<Port: %s, %s, %s, %s>" % (self.name, self.direction, self.type, self.length)
25 if __name__ == "__main__":
26 a = Port("a", IN, None)
27 b = Port("b", IN, None)
28 c = Port("c", OUT, None)
30 print a
31 print b
32 print c