6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 5:18 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Circuit simulation
PostPosted: Wed Jul 13, 2016 3:37 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
Sorry, this isn't super relevant to 6502 but maybe it still fits.

I have written a JavaScript library that loosely works with components such as AND gates, NAND, etc. My original intention was to use it in a graphical way so that I could build a circuit and see how certain things work. For example, turning on address pins that are connected to glue logic would graphically show chip selects turning green or red, etc.

Then I started wondering if there is already something out there like that. I'm not looking for a super advanced tool that simulates current, resistors, etc. Basically a way to test state machines.

Do any of you know if something like that is out there? If not, I may continue building this tool so that I can have one.

I hope I'm clear on this. But, imagine some NAND gates, 74138, etc. connected to a 6502. Then, imagine clicking A15 high and watching the other components light up.

That's what I'm looking for.

Thanks.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Wed Jul 13, 2016 8:18 pm 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 282
Location: Placerville, CA
There's a variety of logic simulators out there, but most of them seem to be only in various stages of completion; it seems like everybody figures if you need something more advanced you're supposed to just learn Verilog. Logisim is probably close to what you're looking for, but its selection of 74-series components is rather limited (not even one of the various ALUs, for example.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Wed Jul 13, 2016 8:29 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
Thanks for the suggestion. :-)

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Wed Jul 13, 2016 8:44 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Can I be really lazy here and just dump a few likely looking pointers? I looked for in-browser simulators, because that's how I think these days:
https://simulator.io/
https://www.circuitlab.com
http://www.doc.gold.ac.uk/~mas01cr/teac ... Logic-Sim/

This one's Java:
http://www.tetzl.de/java_logic_simulator.html

These ones need Flash:
http://www.docircuits.com/
http://www.neuroproductions.be/logic-lab/
http://logic.ly/demo/

(Yes, it seems I can be that lazy! Probably these will be too weak for what you want.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Wed Jul 13, 2016 8:46 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
Those look great. I knew about Circuit Lab but had some trouble with it in the past.

Thanks!

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Tue Sep 06, 2016 12:57 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Just came across Partsim which looks good for circuit simulation - fitting the title of the thread but not the original request, because it offers analogue components. But you could build logic gates out of FETs and resistors, or indeed out of diodes and bipolar transistors... or you could build switching logic out of relays and switches!


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Fri Sep 09, 2016 12:36 pm 
Offline
User avatar

Joined: Tue Jun 07, 2016 4:34 pm
Posts: 53
I've found this GPLed javascript (actually GWT) simulator: https://github.com/pfalstad/circuitjs1
There is also an online version available, it has current flow visualization, scopes and plenty of components and example circuits. Don't know how far you can get as for circuit complexity but seems a nice tool to play with.


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Tue Aug 13, 2019 8:09 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I've just seen a link to the falstad simulator online. Looks pretty good: digital and analogue.
https://www.falstad.com/circuit/circuitjs.html

Here's a switching network:
http://tinyurl.com/yxcm2ecr
(Via Al Williams on hackaday)


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Tue Aug 13, 2019 9:10 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
It's kind of basic but I have had a lot of good luck with Atanua. It works well enough to build a simple computer from 7400 parts, so would probably work for what you're doing.


Attachments:
7400 computer in atanua.png
7400 computer in atanua.png [ 544.82 KiB | Viewed 2613 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Tue Aug 13, 2019 9:17 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Looks good! (open source and cross-platform)
https://sol.gfxile.net/atanua/features.html


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Thu Aug 15, 2019 9:35 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Do any of these give any help in checking timing calculations? Besides the full-blown analogue sims, that is. This requires, for example, that as well as H, L, and Z states, each output pin would need an X state to indicate that its state was not guaranteed, so could be in the process of transitioning and/or could glitch. Nodes would inherit the H or L state if all output pins feeding it are in that state or Z, and X otherwise.

The sim would then need to step in units of nanoseconds with appropriate propagation delays within components, rather than simply picking some component whose inputs had changed and recalculating its output instantaneously. An output pin would stay in its original state for the minimum hold time since an influencing signal changed from valid to X, then itself change to X until the maximum propagation time from the triggering signal becoming valid was met.

Such a sim would still be a simplification due to various analogue effects that show up in practice, but as many of these effects are summed up by the datasheet specs anyway, the results would be useful. They could, for example, identify some of the more common bus setup problems we see around here.


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Fri Aug 16, 2019 8:04 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Conventionally, although it's possible to run logic simulations with timing, it's normal to run timing analysis: the synthesis tools used for programmable logic do this. Rather than simulating, and in some sense hoping that all critical conditions will arise, a timing analysis is exhaustive, adding up all the longest paths (and also all the shortest paths) and taking into account some prediction of clock skew, to see if setup time and hold time constraints are met.


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Fri Aug 16, 2019 8:45 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Sure, but theoretically you can work through the same kind of analysis to check whether your raw logic is correct.

Some people can do that, others need a simulation to be sure or for debugging. I think the same people would benefit from timing considerations being taken into account.


Top
 Profile  
Reply with quote  
 Post subject: Re: Circuit simulation
PostPosted: Fri Aug 16, 2019 9:10 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
It's true, you can do timing analysis by hand - and before timing analysers, you had to! Timed simulations, though, are not a good way to be sure about timing, unless your design is very simple. There's a combinatorial explosion of paths, and not only is it difficult to sensitise each path and observe the consequence, but it's difficult to know which paths are covered and which not.

Having said which, for the basics of CPU+glue+RAM+ROM, in a minimal six-chip computer, yes, timed simulation could give you some confidence. (For something complex like one of BDD's POC machines, less so, I think.)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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: