Git Product home page Git Product logo

6502sim's Introduction

6502 Verilog Gate-Level Simulator

This is a near gate-level simulator of the 6502 microprocesor with all internal control signals represented. Most of the control signals come from the random_control_logic block.

Net numbers used correspond to those used by Visual6502.org: https://github.com/trebonian/visual6502/blob/master/nodenames.js

The organization of the simulator is based on the Hanson block diagram.

This model is not intended for synthesis but rather to learn and observe the actual inner workings of the 6502.

To run the simulator using iverilog:
> iverilog -o dsn -c file_list.txt
> vvp dsn

This will output 6502_sim.vcd which can be observed using GTKWave.

You can change the program that is run by modifying 6502_tb.v.

Dependencies

A Verilog simulation tool such as Icarus Verilog.
A waveform viewer such as GTKWave.

Installation

Note the dependencies above, then simply download this package into a directory.

Usage example

From within your downloaded directory run:
> iverilog -o dsn -c file_list.txt
> vvp dsn
Then open the 6502_sim.vcd file with GTKWave.

You can change the program that is run by modifying 6502_tb.v.

If you assemble your own program, you may find the vmem program in the util folder helpful in converting the program's binary output to a verilog memory file.

Author

Kevin Lynch

License

Distributed under the MIT license.

6502sim's People

Contributors

klynch71 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jotego jrziviani

6502sim's Issues

Possible mistake in interrupt_and_reset_control.v

In line 84 of "interrupt_and_reset_control.v" the wire nmi_l_or_vec_n gets the expression ~(nmi_l | vec_c2 | ~nmi_p);. vec_c2 is a 2-bit array, and verilog doesn't support the use of "|" between a bit and an array. However, many compilers won't show that as an error and would use the bit 0 of the vector for the OR. I don't think this is the intended operation here: since the name of the wire is nmi_l_or_vec_n, I would assume that vec_c2 was mistakenly used instead of vec_n, which is indeed a bit. Is this what happened? If not, is the code doing what it's intended to do?

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.