6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Apr 19, 2024 11:38 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Feb 14, 2011 12:12 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
Peter Monta has dug some more gold out of the 6502 data collected for visual6502.org - he has now committed mask data, mask graphics and a spice netlist for the 6502 to his FPGA netlist tools project on github.

The effect is that he's going in both directions: deriving a gate-level netlist from the transistors for FPGA purposes(*), and deriving circuit-level information which allows analogue simulation.

I've seen some early traces, but we suspect there are a few tweaks needed to the netlist, so it's too early to post pictures. Hopefully we'll see some public pictures soon. Meantime, you can run your own spice simulation, at the rate of about 16 clock cycles per hour - about 4mHz (not to be confused with 4MHz.)

Cheers
Ed

(*)See also Xor's FPGA core which has a family resemblance.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Feb 19, 2011 4:36 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
I was able to run a short test simulation - it took about 30 mins to run through reset and then 20mins to do 10 cycles of instructions.

Image

(Edit - the above have link-rotted but see the attachments.)

Of interest in these traces:
    - internal busses only rise to 4V or so due to NMOS threshold drop
    - the so-called precharge often fights against pulldowns during phi2 rseulting in an intermediate voltage
    - sometimes a bus will rapidly drop by a small voltage as it charge-shares with another bus

Here's what I did:
    - downloaded Peter Monta's FPGA-netlist-tools project (using git, or tar, or gzip)
    - installed ngspice and gwave
    - changed into the masks/6502 subdirectory
    - modified the 6502-run.spice file to "tran 10ns 100us"
    - modified the 6502-system.spice file to tie the databus to 0xCA
    - run spice using "ngspice --batch 6502-run.spice" to produce a file 6502-spice-rawfile.raw
    - run gwave with a config file to display the signals and busses I'm interested in (otherwise, drag and drop)

Segher has written up some of his findings on the visual6502 wiki. (Edit: archived link, thanks for noting the link rot)

Edit: uploaded a new image of the waveforms, as the old one had rotted away. You can see the reset signal rising, and the sync signal showing activity. You can also see the voltages on the special bus and internal databus not always being full-rail.


Attachments:
6502-ngspice-gwave-2.png
6502-ngspice-gwave-2.png [ 68.49 KiB | Viewed 6563 times ]
6502-ngspice-gwave.png
6502-ngspice-gwave.png [ 47.79 KiB | Viewed 6563 times ]


Last edited by BigEd on Wed Jan 05, 2022 10:06 am, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 05, 2015 4:51 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
Edit: I realise I can make the simulation datafile available, so anyone can explore the results (presumably using gwave) even without running the simulation. You need 300Mbyte of space and the download is a 165Mbyte zip file:
https://www.dropbox.com/s/b0auj32majmd7 ... a.zip?dl=0

Here are the input files, as tweaked:

Code:
$ cat 6502-run.spice
* top-level ngspice script

.control
  source 6502-system.spice
  tran 10ns 100us
  write 6502-spice-rawfile.raw
.endc

.end


Code:
$ cat 6502-system.spice
* 6502 circuit simulation

* FET models

.model efet NMOS level=1 vt0=1.0
.model dfet NMOS level=1 vt0=-3.0

* handle floating nodes

.option rshunt = 1.0e12

* supply voltages

v0 gnd! 0 dc 0
v1 Vdd 0 dc 5

* pull down the data bus to supply 0x00 for reads and allow writes to be seen

r0 db0 0 10k
r1 db1 Vdd 10k
r2 db2 0 10k
r3 db3 Vdd 10k
r4 db4 0 10k
r5 db5 0 10k
r6 db6 Vdd 10k
r7 db7 Vdd 10k

* pin settings, reset pulse, clock waveform

v10 res 0 pulse (0 5 20u 2n 2n)
v11 so 0 dc 0
v12 rdy 0 dc 5
v13 nmi 0 dc 5
v14 irq 0 dc 5
v15 clk0 0 pulse (0 5 10n 2n 2n 2u 4u)

* the 6502 model

.include "6502.spice"

.end


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 05, 2015 5:50 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
(Updated previous post with a link to a zip file, so you can waveform-view without running a simulation)


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 05, 2022 5:11 am 
Offline

Joined: Tue Jan 04, 2022 2:43 am
Posts: 9
Quote:
Segher has written up some of his findings on the visual6502 wiki.


That link (and the whole 6502 wiki) is unfortunately nonfunctional, but thankfully archive.org captured it; the latest capture was in April 2021:

https://web.archive.org/web/20210405071 ... 2_datapath


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 05, 2022 10:01 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
Thanks! I've updated my link accordingly.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: