cut over intr decls
[pinmux.git] / src / bsv / peripheral_gen.py
1 class PBase(object):
2 pass
3
4 class uart(PBase):
5 def importfn(self):
6 return " import Uart16550 :: *;"
7
8 def ifacedecl(self):
9 return " interface RS232_PHY_Ifc uart{0}_coe;" \
10 " method Bit#(1) uart{0}_intr;"
11
12
13 class rs232(PBase):
14 def importfn(self):
15 return " import Uart_bs::*;\n" \
16 " import RS232_modified::*;"
17
18 def ifacedecl(self):
19 return " interface RS232 uart{0}_coe;"
20
21
22 class twi(PBase):
23 def importfn(self):
24 return " import I2C_top :: *;"
25
26 def ifacedecl(self):
27 return " interface I2C_out i2c{0}_out;" \
28 " method Bit#(1) i2c{0}_isint;"
29
30
31 class qspi(PBase):
32 def importfn(self):
33 return " import qspi :: *;"
34
35 def ifacedecl(self):
36 return " interface QSPI_out qspi{0}_out;" \
37 " method Bit#(1) qspi{0}_isint;"
38
39
40 class pwm(PBase):
41 def importfn(self):
42 return " import pwm::*;"
43
44 def ifacedecl(self):
45 return " interface PWMIO pwm_o;"
46
47
48 class gpio(PBase):
49 def importfn(self):
50 return " import pinmux::*;" \
51 " import mux::*;" \
52 " import gpio::*;"
53
54 def ifacedecl(self):
55 return " interface GPIO_config#({1}) pad_config{0};"
56
57
58
59 class PFactory(object):
60 def __init__(self):
61 return {'uart': uart,
62 'rs232': rs232,
63 'twi': twi,
64 'qspi', qspi,
65 'pwm', pwm,
66 'gpio', 'gpio'
67 }