Git Product home page Git Product logo

Comments (4)

maehne avatar maehne commented on June 12, 2024

@BFH-ktt1: Could you have a look, as you implemented this?

from logisim-evolution.

jonicho avatar jonicho commented on June 12, 2024

It seems the patch I suggested isn't enough, as a cpu I designed (which works in Logisim and doesn't use any gated clocks as well) only works on an FPGA with the following patch which removes the output register s_ramdataOut when the RAM is set to line enables:

@@ -44,8 +44,10 @@ public class RamHdlGeneratorFactory extends AbstractHdlGeneratorFactory {
     final var async = StdAttr.TRIG_HIGH.equals(trigger) || StdAttr.TRIG_LOW.equals(trigger);
     final var ramEntries = (1 << nrOfaddressLines);
     final var truncated = (nrOfBits % 8) != 0;
+    if (byteEnables) {
+      myWires.addWire("s_ramdataOut", nrOfBits);
+    }
     myWires
-        .addWire("s_ramdataOut", nrOfBits)
         .addRegister("s_tickDelayLine", 3)
         .addRegister("s_dataInReg", nrOfBits)
         .addRegister("s_addressReg", nrOfaddressLines)
@@ -120,9 +119,11 @@ public class RamHdlGeneratorFactory extends AbstractHdlGeneratorFactory {
               inputRegs : {{process}}({{clock}}, {{tick}}, address, dataIn, we, oe) {{is}}
               {{begin}}
                  {{if}} (rising_edge({{clock}})) {{then}}
+                    {{if}} ({{tick}} = '0') {{then}}
+                        s_addressReg <= address;
+                    {{end}} {{if}};
                     {{if}} ({{tick}} = '1') {{then}}
                         s_dataInReg  <= dataIn;
-                        s_addressReg <= address;
                         s_weReg      <= we;
                         s_oeReg      <= oe;
               """);
@@ -182,7 +183,7 @@ public class RamHdlGeneratorFactory extends AbstractHdlGeneratorFactory {
                       {{if}} (s_we = '1') {{then}}
                          s_memContents(to_integer(unsigned(s_addressReg))) <= s_dataInReg;
                       {{end}} {{if}};
-                      s_ramdataOut <= s_memContents(to_integer(unsigned(s_addressReg)));
+                      dataOut <= s_memContents(to_integer(unsigned(s_addressReg)));
                    {{end}} {{if}};
                 {{end}} {{process}} mem;
                 """);
@@ -206,18 +207,6 @@ public class RamHdlGeneratorFactory extends AbstractHdlGeneratorFactory {
               .add("   {{end}} {{if}};")
               .add("{{end}} {{process}} res{{1}};", i);
         }
-      } else {
-        contents
-            .add("""
-                res : {{process}}({{clock}}, s_oe, s_ramdataOut) {{is}}
-                {{begin}}
-                   {{if}} (rising_edge({{clock}})) {{then}}
-                      {{if}} (s_oe = '1') {{then}}
-                        dataOut <= s_ramdataOut;
-                      {{end}} {{if}};
-                   {{end}} {{if}};
-                {{end}} {{process}} res;
-                """);
       }
     }
     return contents.empty();

But again, I have no idea what I'm doing as I don't really understand the generated VHDL code, so I would appreciate help.

from logisim-evolution.

SLicudis avatar SLicudis commented on June 12, 2024

How'd you manage to use RAM? I thought it wasn't FPGA-supported
Please tell me how did you manage to do that

from logisim-evolution.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.