From d229a91451fe7077a61dbe7cdc88dfdd96e980dd Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 1 Aug 2018 08:38:53 +0100 Subject: [PATCH] add sdram interface, remove unneeded import --- docs/AddingPeripherals.mdwn | 19 ++++++++++++++++++- src/bsv/bsv_lib/soc_template.bsv | 3 --- src/bsv/peripheral_gen/base.py | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/AddingPeripherals.mdwn b/docs/AddingPeripherals.mdwn index b381cde..091fe1b 100644 --- a/docs/AddingPeripherals.mdwn +++ b/docs/AddingPeripherals.mdwn @@ -285,4 +285,21 @@ is added. So first, we must identify the nearest similar class. FlexBus looks like a good candidate, so we take a copy of src/bsv/peripheral\_gen/flexbus.py called sdram.py. The simplest next step is to global/search/replace -"flexbus" with "sdram". +"flexbus" with "sdram". At this phase, despite knowing that it will +auto-generate the wrong code, we add it as a "supported" peripheral +at the bottom of src/bsv/peripheral\_gen/base.py, in the "PFactory" +(Peripheral Factory) class: + + from gpio import gpio + from rgbttl import rgbttl + from flexbus import flexbus + from sdram import sdram <-- + + for k, v in {'uart': uart, + 'rs232': rs232, + 'sdr': sdram, + 'twi': twi, + 'quart': quart, + +Note that the name "SDR" matches with the prefix used in the pinspec +declaration, back in src/spec/pinfunctions.py, except lower-cased. diff --git a/src/bsv/bsv_lib/soc_template.bsv b/src/bsv/bsv_lib/soc_template.bsv index d35faf2..af2bc31 100644 --- a/src/bsv/bsv_lib/soc_template.bsv +++ b/src/bsv/bsv_lib/soc_template.bsv @@ -83,9 +83,6 @@ package socgen; `ifdef VME import vme_master::*; `endif - `ifdef FlexBus - import FlexBus_Types::*; - `endif {0} /*========================= */ diff --git a/src/bsv/peripheral_gen/base.py b/src/bsv/peripheral_gen/base.py index 2cd1ebc..4758655 100644 --- a/src/bsv/peripheral_gen/base.py +++ b/src/bsv/peripheral_gen/base.py @@ -893,10 +893,12 @@ class PFactory(object): from gpio import gpio from rgbttl import rgbttl from flexbus import flexbus + from sdram import sdram for k, v in {'uart': uart, 'rs232': rs232, 'twi': twi, + 'sdr': sdram, 'quart': quart, 'mqspi': mqspi, 'mspi': mspi, -- 2.30.2