6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 2:16 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Wed Dec 28, 2022 3:28 pm 
Offline

Joined: Wed Dec 28, 2022 3:15 pm
Posts: 1
Hi All,

New to the forums, and new to the idea of designing a 6502 type computer from the ground up. I do however have a background in electronic and computer engineering, so what I'm struggling with is finding software to help me design/test the system logic for a 6502 based homebrew computer. Does any one have any recomendations of what I can use before taking the next step of building it in hardware/breadboard?

Thankyou for any suggestions you might have.


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 28, 2022 6:12 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Welcome!

Some people will draw out truth tables and hand-simulate, perhaps drawing out waveforms. Some will use a spreadsheet to help.

But if you want a software tool, you probably are looking for a logic simulator. One example is logisim, which works with schematics (as opposed to textual descriptions)
http://www.cburch.com/logisim/

Some people will learn how to describe their hardware in HDL, either in Verilog or in VHDL, and will then use a simulator such as icarus or ghdl, or perhaps one which comes with tools from Xilinx or Altera.

Hope this helps!


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 28, 2022 7:45 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 964
Location: Potsdam, DE
If I might make so bold, the original Logisim is no longer supported and hasn't been for years - which doesn't mean it's useless, but I find the later extensions to it, in particular Logisim-Evolution (https://github.com/logisim-evolution/logisim-evolution). It's remarkably similar to the original but is still actively maintained and has a number of useful improvements.

Either though are sufficient that one can build a computer from scratch - even implementing your own TTL equivalent parts to prove that it can be built in the real world. I have a TTL simulation of an 8080 processor which cheerfully executes Tiny Basic - albeit very very slowly.

It's a very good tool for proving that your logic ideas work though it doesn't include anything like the 6502 core directly. It can be difficult to identify race conditions driving clocks unexpectedly; in general, if something doesn't work in Logisim Evolution it won't work in the real world. (As a rule, never directly generate clock signals from combinational logic).

Neil


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 28, 2022 8:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Thanks for the info!


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 29, 2022 8:28 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 964
Location: Potsdam, DE
One caveat: the TTL implementations provided by default in Logisim Evolution are missing some (to me) obvious parts (e.g. 138, 374, 541) and I have a vague memory of finding one part which didn't behave as the datasheet suggested it should (and I can't recall which!).

I haven't been able to find a reference to create new parts or edit existing ones, so I often need to use gate-level simulations of TTL parts.

Attached is a simulation for a simple VGA output extension for a computer based on Grant Searle's minimal system - it's currently untested as I haven't built it yet, but the PCB is pretty.

Neil


Attachments:
grant-vga.png
grant-vga.png [ 120.57 KiB | Viewed 4284 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 01, 2023 4:07 pm 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
I've used Logisim Evolution pretty extensively to simulate a computer using a W65C816 and 74 series ICs. And met with mixed results.

Logisim is amazing as a logic gate simulator and also one of the most intuitive editors I've used in terms of just being able to draw up a circuit. Logisim Evolution takes Logisim (actually Logisim Holy Cross) and adds a lot of missing features, performance and general quality of life improvements. But. Also includes some very verilog related restrictions and introduces some pretty bad bugs*.

I'd recommend Logisim Evolution to start with but it becomes fragile with large circuits. And as barnacle has said it is also missing a lot of the common 74 series ICs.

I've coded up a bunch of them myself (including the 138, 374, 541)
Attachment:
Decoders.png
Decoders.png [ 12.47 KiB | Viewed 4142 times ]

And they are all publicly available with an unfortunate caveat. To simulate the W65C816 I had to make a change to the Logisim Evolution source. That pull request was accepted into 3.7.1 but was then overwritten by someone else's bad merge and lost.
Attachment:
w65c816.png
w65c816.png [ 25.71 KiB | Viewed 4142 times ]


And here is where things get tricky, and why don't recommend Logisim for large projects. It's fundamentally not built for it. Digital is another option, is more mature in terms of developing (test cases) and is faster. But I could not work out how to write plug-ins for it and could not simulate a 6502 or 65816 in it.

If you want to go the Logisim route PM me and I'll walk you through how to get Logisim Evolution going with the changes I've made. Or, a thought just occurred to me, I may be able to host the executable here.

Going a but off topic, what I ultimately am looking for is something like Logisim that understands voltage levels, propagation delays, has actual working bi-directional ports and can export to KiCad. Of course no such program exists but... it would be great if it did and be pretty much the perfect tool for 6502 development.

* some of which I've fixed.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 02, 2023 6:57 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 964
Location: Potsdam, DE
AndrewP wrote:
Going a bit off topic, what I ultimately am looking for is something like Logisim that understands voltage levels, propagation delays, has actual working bi-directional ports and can export to KiCad. Of course no such program exists but... it would be great if it did and be pretty much the perfect tool for 6502 development.


Now that would be nice. Analog's ltspice can do that sort of simulation of gates, but is pretty tedious to set everything up correctly and has the *worst* user interface it has ever been my fate to use. There is a simulator available in KiCad but I have never tried to use it; perhaps I should. I believe that there is a simulator in Altium which works with digital components but I've never used Altium...

Neil


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2023 7:16 pm 
Offline

Joined: Fri Oct 04, 2019 4:26 am
Posts: 23
Location: Rancho Cordova, CA
There is Digital which is Logisim-like from what I've heard. I've used Digital but not Logisim myself so I'm not in the position to compare and contrast.

https://github.com/hneemann/Digital

Greg


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 04, 2023 7:02 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 964
Location: Potsdam, DE
A quick look at the documentation suggests it has a much better TTL parts list.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 04, 2023 11:09 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
Digital is kinda the spiritual successor to Logisim. The big problem is I could not work out how to implement custom Java components in it (although I think Agumander has been able to) and for that reason I couldn't simulate a running 65816 (or 6502) as I could in Logisim.

akohlbecker has managed to implement custom ICs in Digital using it's digital file format (the suggested way of doing custom ICs). I think Proxy also uses Digital.

Back when I was evaluating Digital a few years ago the documentation was really scant which made using it outside of the obvious kinda difficult. I don't know if that's improved since.

barnacle wrote:
Now that would be nice. Analog's ltspice ... simulator available in KiCad
I found them both way overkill for what I want (a logic simulator) and a mission to setup.

And with all of that said...

don't hold your breath, but
Attachment:
Logicim.png
Logicim.png [ 29.2 KiB | Viewed 4001 times ]
I'm working on simulator specifically for building a computer around the 65816 that does understand propagation delays, voltage levels, 74 series ICs, has a similar interface to Logisim and is simpler (and thus faster) than a proper Spice simulator. (and has enough detail that it can export a complete KiCad schematic*)

There's still a lot of work ahead before I can really post about it in its own thread but I'm hoping it will be tool that can simulate most of the designs I've seen on this forum.

* I had a long rant sometime ago about the mistakes I made transcribing circuits from Logisim to Kicad which is why automating that export is so important to me.


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

All times are UTC


Who is online

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