add sdram interface, remove unneeded import
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Aug 2018 07:38:53 +0000 (08:38 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Aug 2018 07:38:53 +0000 (08:38 +0100)
docs/AddingPeripherals.mdwn
src/bsv/bsv_lib/soc_template.bsv
src/bsv/peripheral_gen/base.py

index b381cde6f046beb1726e44cf02ec3160ca958ed0..091fe1b27733b1c8d26be3b9d3a54b814c11051b 100644 (file)
@@ -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.
index d35faf2f012f977041a5b199b63e5fac207ebb2d..af2bc31cb41ab68494fc12cfcdb88504091ea6ee 100644 (file)
@@ -83,9 +83,6 @@ package socgen;
     `ifdef VME
         import vme_master::*;
     `endif
-    `ifdef FlexBus
-        import FlexBus_Types::*;
-    `endif
 {0}
 
     /*========================= */
index 2cd1ebcdeb9d1636bec8fc702c757fd970babcd7..475865574b479105aba7cf85b094ed13a5951cd8 100644 (file)
@@ -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,