From d9fa0a0f6b4a79bf82e37061a3e5a0676b3c3e0d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 26 Jul 2018 09:26:18 +0100 Subject: [PATCH] add flexbus as fast interface --- src/bsv/bsv_lib/soc_template.bsv | 15 --------------- src/bsv/peripheral_gen/base.py | 11 ++++++++--- src/bsv/peripheral_gen/jtag.py | 2 +- src/spec/i_class.py | 2 +- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/bsv/bsv_lib/soc_template.bsv b/src/bsv/bsv_lib/soc_template.bsv index 9d853f7..e99b9b1 100644 --- a/src/bsv/bsv_lib/soc_template.bsv +++ b/src/bsv/bsv_lib/soc_template.bsv @@ -109,9 +109,6 @@ package Soc; interface Vme_out proc_ifc; interface Data_bus_inf proc_dbus; `endif - `ifdef FlexBus - interface FlexBus_Master_IFC flexbus_out; - `endif {1} endinterface @@ -147,10 +144,6 @@ package Soc; `ifdef VME Ifc_vme_top vme <-mkvme_top(); `endif - `ifdef FlexBus - AXI4_Slave_to_FlexBus_Master_Xactor_IFC #(32, 64,0) - flexbus <- mkAXI4_Slave_to_FlexBus_Master_Xactor; - `endif Ifc_slow_peripherals slow_peripherals <-mkslow_peripherals( core_clock, core_reset, uart_clock, uart_reset, clocked_by slow_clock , @@ -219,11 +212,6 @@ package Soc; [fromInteger(valueOf(VME_slave_num))], vme.slave_axi_vme); `endif - `ifdef FlexBus - mkConnection (fabric.v_to_slaves - [fromInteger(valueOf(FlexBus_slave_num))], - flexbus.axi_side); - `endif // fabric connections {5} @@ -306,9 +294,6 @@ package Soc; `ifdef VME interface proc_ifc = vme.proc_ifc; interface proc_dbus = vme.proc_dbus; - `endif - `ifdef FlexBus - interface flexbus_out = flexbus.flexbus_side; `endif method Action boot_sequence(Bit#(1) bootseq) = core.boot_sequence(bootseq); diff --git a/src/bsv/peripheral_gen/base.py b/src/bsv/peripheral_gen/base.py index caad20f..0e450f4 100644 --- a/src/bsv/peripheral_gen/base.py +++ b/src/bsv/peripheral_gen/base.py @@ -266,14 +266,17 @@ else""" def extfastifinstance(self, name, count): return '' - def _extifinstance(self, name, count, suffix, prefix, samename=False): + def _extifinstance(self, name, count, suffix, prefix, samename=False, + ifsuffix=None): + if ifsuffix is None: + ifsuffix = '' pname = self.get_iname(count) if samename: sname = pname else: sname = self.peripheral.iname().format(count) - template = "interface {0}{3} = {2}{1};" - return template.format(pname, sname, prefix, suffix) + template = "interface {0}{3} = {2}{1}{4};" + return template.format(pname, sname, prefix, suffix, ifsuffix) def extifinstance2(self, name, count): return '' @@ -715,6 +718,7 @@ class PFactory(object): from qspi import qspi, mqspi from gpio import gpio from rgbttl import rgbttl + from flexbus import flexbus for k, v in {'uart': uart, 'rs232': rs232, @@ -729,6 +733,7 @@ class PFactory(object): 'sd': sdmmc, 'jtag': jtag, 'lcd': rgbttl, + 'fb': flexbus, 'gpio': gpio }.items(): if name.startswith(k): diff --git a/src/bsv/peripheral_gen/jtag.py b/src/bsv/peripheral_gen/jtag.py index bfebe07..dd3e2fa 100644 --- a/src/bsv/peripheral_gen/jtag.py +++ b/src/bsv/peripheral_gen/jtag.py @@ -11,7 +11,7 @@ class jtag(PBase): def fastifdecl(self, name, count): # YUK! - return "Ifc_jtagdtm jtag{0}_out;".format(count) + return "interface Ifc_jtagdtm jtag{0}_out;".format(count) def mkfast_peripheral(self): return """\ diff --git a/src/spec/i_class.py b/src/spec/i_class.py index 99c8359..88cbdcf 100644 --- a/src/spec/i_class.py +++ b/src/spec/i_class.py @@ -60,7 +60,7 @@ def pinspec(): } ps = PinSpec(pinbanks, fixedpins, function_names, - ['lcd', 'jtag', 'flexbus' ]) + ['lcd', 'jtag', 'fb' ]) # Bank A, 0-27 ps.gpio("", ('A', 0), 0, 0, 28) -- 2.30.2