From 8f7c3935d2fa00387a2533022d02db1d87f6d981 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 20 Jul 2018 04:58:11 +0100 Subject: [PATCH] cut over intr decls --- src/bsv/peripheral_gen.py | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/bsv/peripheral_gen.py b/src/bsv/peripheral_gen.py index 94e1274..a97697e 100644 --- a/src/bsv/peripheral_gen.py +++ b/src/bsv/peripheral_gen.py @@ -1,15 +1,16 @@ class PBase(object): pass -class UART(PBase): +class uart(PBase): def importfn(self): return " import Uart16550 :: *;" def ifacedecl(self): - return " interface RS232_PHY_Ifc uart{0}_coe;" + return " interface RS232_PHY_Ifc uart{0}_coe;" \ + " method Bit#(1) uart{0}_intr;" -class RS232(PBase): +class rs232(PBase): def importfn(self): return " import Uart_bs::*;\n" \ " import RS232_modified::*;" @@ -18,12 +19,13 @@ class RS232(PBase): return " interface RS232 uart{0}_coe;" -class spi(PBase): +class twi(PBase): def importfn(self): return " import I2C_top :: *;" def ifacedecl(self): - return " interface I2C_out i2c{0}_out;" + return " interface I2C_out i2c{0}_out;" \ + " method Bit#(1) i2c{0}_isint;" class qspi(PBase): @@ -31,13 +33,35 @@ class qspi(PBase): return " import qspi :: *;" def ifacedecl(self): - return " interface QSPI_out qspi{0}_out;" + return " interface QSPI_out qspi{0}_out;" \ + " method Bit#(1) qspi{0}_isint;" class pwm(PBase): def importfn(self): + return " import pwm::*;" + + def ifacedecl(self): return " interface PWMIO pwm_o;" + +class gpio(PBase): + def importfn(self): + return " import pinmux::*;" \ + " import mux::*;" \ + " import gpio::*;" + def ifacedecl(self): - return " import pwm::*;" + return " interface GPIO_config#({1}) pad_config{0};" + + +class PFactory(object): + def __init__(self): + return {'uart': uart, + 'rs232': rs232, + 'twi': twi, + 'qspi', qspi, + 'pwm', pwm, + 'gpio', 'gpio' + } -- 2.30.2