From VisualChips

(Difference between revisions)
Jump to: navigation, search
(Busses and signals of interest: fleshed out)
m (Protected "JssimUserHelp" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))

Revision as of 16:15, 28 November 2010

The Visual6502 javascript simulator has two entry pages:

You might also be using a pre-released version of the simulator. As this help is on our wiki, there's only one help page for all versions.


Help for simple mode

In simple mode, you see the chip graphics on the left, the control buttons and chip status at top right, and the memory table below that. There's a link to the advanced page, and the overall layout is fixed: there are no draggable bars between the sections.

Graphics help

You can pan and zoom the chip graphics using

  • '>' on the keyboard to zoom in
  • '<' on the keyboard to zoom out
  • click and drag to pan

Click in the graphics area to highlight any shape on the chip: all the connected shapes will be highlighted and the name of the node, if any, will be displayed in the chip status area at top right.

For example, if you click on the square shape at top left of the chip, you'll see text like

node: 1297 nmi

which tells you that this is the NMI pad - in a real chip, it would be connected to the NMI pin of the package with a gold wire.

The node number is useful only as a unique reference number. If you're interested in the workings of the simulator you'll read the source files and see these numbers used to label all the polygons and transistors which are electrically connected and which therefore are at the same voltage - and therefore represent the same logical signal.

Running the program

Towards the top right you see a set of buttons:

  • run (or stop) - start the simulation, run for as long as you like, then stop it.
  • reset
  • back
  • forward

As the simulation runs you can see the yellow box in the memory area (bottom right) indicating which memory location is being read or written. You may also see the contents of memory changing: perhaps the location just to the right of {{{0040:}}} will count up.

Modifying the program

You can't presently modify the program in the simple page: you need the Advanced page for that.

Help for advanced mode

In advanced mode, there's an additional area at bottom right which can tabulate the state of the machine, and any signals of interest, phase by phase or instruction by instruction. There's also a console for programs which perform I/O: it's possible to interact with a BASIC interpreter for example.

The layout in advanced mode has a couple of draggable boundaries so you can adjust according to what you're doing.

The chip graphics area has some additional controls, and can be hidden altogether.

Finally, in expert mode you can control the simulator and the graphics using additional URL parameters.

Graphics help

All the graphics controls are immediately below the chip graphics area.

Use the keyboard to zoom in and out (z and x or < and >) and once you've zoomed in you can use the mouse to pan around, by clicking and dragging.

If you click on any shape in the chip, the status display (top right) will give you the coordinates and the node number, and the node name if it has one.

The second line of graphics controls allow you to select layer visibility. Chips are designed and fabricated as a series of thin layers in and on the silicon. With these controls you can get a clearer idea of the geometry in each layer. For example, most of the long-distance connections are in metal, with some polysilicon. The logic gates themselves use diffusion and polysilicon only, in general.

The next line of graphics controls allow you to find the geometry corresponding to a node name, or number, or a collection of them. The Clear Highlighting button also clears the logic level indication: all the diffusion becomes yellow, all the polysilicon purple, and the metal translucent.

The 'Animate during simulation' checkbox allows you to run the simulation faster, by skipping the logic level highlighting of the chip graphics.

'Hide Chip Layout' rearranges the page layout so you can concentrate on the right hand side panels - if you're looking at the logical behaviour and not the chip layout.

Finally, 'Link to this location' provides an URL which you can share, corresponding to the current pan and zoom, so you can discuss whichever interesting layout features you find. For example

Running the program

Modifying the program

Tracing machine state

Busses and signals of interest

You can use the 'Trace these too' box to list more signals which you're interested in - you might even use 'Trace less' several times to make this the exact list of signals to tabulate.

Some names are handled specially and are not individual signals or busses:

  • cycle is the count of cycles since reset
  • pc is the program counter, combining pcl and pch
  • p is the status register, combining p0 to p7 (there is no p6, and even p5 isn't really in P!)
  • tcstate collects the timing control bits, which are labelled 'clock1','clock2','t2','t3','t4','t5'
  • State is a more readable version of tcstate, which names the low bits, from T0 to T5. Note that T0 and T1 are not what they seem (link needed)
  • Fetch is blank unless the 'sync' pin is active, in which case it is a description of the 6502 opcode on the data bus (db).
  • Execute is a description of the 6502 opcode in the ir (Instruction Register)
  • plaOutputs is a list of all the active outputs from the instruction decode PLA
  • DPControl is a list of all the active control signals into the datapath

If you need to tabulate a signal which is in negative sense, use a leading minus. For example, '-pd' is the instruction predecode register.

The signal names are mostly taken from Donald Hanson's block diagram

URL interface

There's a variety of parameters which can be passed on the URL, to make it easy to share examples and discoveries as direct links into the simulator. In all cases these are passed like this:

positioning the graphics window
select a larger canvas for improved graphical detail (uses more RAM)
suppress the simulation, for faster startup of a purely graphical session
suppressing graphics (same as the Hide Chip Layout button)
running for a fixed number of clock phases
see more groups of interesting signals in the tabulation
add specific signals to the tabulation
set the fastforward step count (for benchmarking, or interactive programs)
load a test program, or patch memory contents
adjust the reset vector
set up some input pin transitions (reset, IRQ, NMI)
check every signal value against a golden checksum (for checking simulator code changes)

The final reference on the URL capabilities is the source code.

Personal tools