Giter Club home page Giter Club logo

py-v's People

Contributors

kyaso avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

tarunjaye

py-v's Issues

Events

To model delayed events, such as a DRAM access, it would be nice if we could post events into the future.

Selective signal probing

Instead of printing all ports/wires, allow the user to specify which ports to log. E.g. using a text file. The simulator would then only print the ports matching the strings given in the text/config file.

Prevent reading of output ports

Description

Scenario: Assume there is a module A, which contains another module B. A, inside its process() method, takes B's output (by directly reading B's output port), computes something with it, and writes something to its own output.

Regardless of how B's input ports are wired up (they could be either connected directly to one of A's inputs or, they could be written to during A's processing), A will always be processed before B.

Now, when B's output changes, who is notified? Only input ports can notify their parent module.

Solution

Similar to Verilog/VHDL, when we want to use some output of an inner module within the outer module, we should connect that output to some wire. That way, whenever the inner module's output changes, the change is also captured by the wire, thus adding the outer module to the simulation queue.

There is no real need to read an output port anyways, so we could just throw an exception when an output port is read.

Prevent invalid memory/list access Python exception

(This issue is not referring to invalid memory accesses caused by running programs)

When during the current cycle some module's process function gets executed with unstable port values, and one of these unstable ports is used as a memory address (or any other list for that matter), we might have an invalid access exception (in Python).

However, as the port is unstable, we have to assume that it eventually will stabilize, and then the process method is executed again with valid inputs. While we are processing with unstable values, we need to relax access checks. Catching the exception and maybe issuing a warning instead might be a solution.

Port default values

Description

Currently, we have two choices for default values of Ports:

  • Some numeric value (e.g. 0)
  • None

Both options have issues. When a module gets added to the simulation queue, but at least one input port still has a None value, computation might fail. On the other hand, a numeric default value could coincide with the reset value of a connected register. Thus at the very beginning of the sim, when the reset is asserted, the port will not see any change. However, it is not guaranteed that the output ports of the corresponding module have valid values, so forced processing in the first cycle is mandatory.

Proposal

Introduce a flag attribute in the Port class that indicates whether the port is written for the first time or not. When the port is written for the first time, the _propagate() method is called irrespective of the new value. From the next write on, the normal behavior applies, i.e., only propagate when the value has changed.

Add basic exception handling

Add some basic exception handling as required by the RISC-V spec.

  • Illegal instruction
  • Instruction address misaligned
  • Load address misaligned
  • Store/AMO address misaligned

The following exceptions should be covered in the future:

  • Instruction access fault
  • Load access fault
  • Store/AMO access fault

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.