Close

Hack Chat Transcript, Part 1

A event log for Logic Simulation Hack Chat with Al Williams

The Truth (Table) Is Out There

dan-maloneyDan Maloney 03/02/2022 at 21:150 Comments

Dan Maloney12:00 PM
OK, folks, good afternoon/evening/morning to you all. We're ready to kick off the Hack Chat! I'm Dan, I'll be moderating today along with Dusan for Hackaday's own Al Williams!

Dusan Petrovic12:00 PM
Hi everyone!

Dusan Petrovic12:00 PM
Hi Al!

Al Williams12:01 PM
Hello

Al Williams12:01 PM
Good to see everyone virutally

Dan Maloney12:01 PM
I just saw Al over on the event page chat, asked him to pop over here.

There we go -- hi Al!

Bil Herd12:01 PM
Hey Al, Dan

Al Williams12:01 PM
I'm in multiple places at once....

Dan Maloney12:02 PM
That sounds like something from the DSM-V...

Bil Herd12:02 PM
Ah but the more we know about where you are the less we know about your energy state

Al Williams12:02 PM
How's your cat Bil?

Bil Herd12:02 PM
Lol... good. Lost the turkey in the cold snap tho...

Al Williams12:02 PM
Ready to go Dan?

Al Williams12:03 PM
Good to see everyone here...

Darrin B joined  the room.12:03 PM

Al Williams12:04 PM
Ok well let me say a few things about simulation and then we can just kind of freewheel with wherever we want to go with the topic.

Dan Maloney12:04 PM
Oh yes, by all means -- how about a little about yourself for those who don't know you?

Al Williams12:04 PM
Well, most of you know me from Hackaday and the old among us will remember I was with Dr. Dobb’s Journal and some other magazines back when magazines were made from forest products. Let’s see… I seem to bounce around between things… my undergraduate degree is about 80% EE but I finished with a CS degree (long story). Then I have a Master’s in EE from Columbia (the University, not the country which is spelled different).

Al Williams12:04 PM
So I’ve done software ranging from low-level assembly to BIOS code. Hardware design from the die level to vacuum tubes to FPGAs. I have designs that have been at the bottom of the ocean and in orbit. I’ve been a ham radio operator for about 45 years or so. I’ve written a bunch of books and a while back I wrote the FPGA bootcamp series that is on hackaday.io.

Al Williams12:04 PM
We actually started out with Bootcamp #1 which uses Verilog, but after talking to some people, I found out that many people really needed to learn just the fundamentals of digital logic. So we did bootcamp #0 which uses online tools to do simulations in your browser. Of course, the Verilog is also a simulation (until it is compiled) and that can be in your browser, too.

stefan joined  the room.12:04 PM

Al Williams12:05 PM
It reminds me of when I was in school a very long time ago. We learned drafting with T-squares and pencils. But we had two weeks of “computer aided drafting” where we punched cards like: rectangle(20,20,100,195) and circle(15,30,44). At the time, I thought that was stupid because the future was drawing stuff on the computer.

Al Williams12:05 PM
But if you look at modern CAD tools, they do let you “code” things so you can have parametric CAD. Some tools like OpenSCAD that’s all you do. If you are making a donut shape, drawing is OK. But if you are making something complex, modeling the relationships is more efficient in the long run. So this also happens with simulations. A lot of people – me included – start learning about Verilog and think that it is stupid because you can just draw schematics. But when you have a CPU with tens of thousands of gates, the schematic entry gets clunky fast. Verilog or VHDL or something like that is the way to go. Consider this 7 segment decoder: http://tinyurl.com/ybqfbk6m

Vs this one:

Al Williams12:05 PM
always @(*)

case (number)

4'h0: dispoutput <= 7'b1111110; // all segments but center

4'h1: dispoutput <= 7'b0110000; // two segments to form "1"

4'h2: dispoutput <= 7'b1101101; // five segments to form "2"

. . .

Ethan Waldo12:06 PM
Amazing, a Hack Chat with someone that types faster than 1 sentence per 3 minutes!

Al Williams12:06 PM
So a few random topics we could chat about...

Schematic entry vs HDL.

What doesn’t simulate well?

What does simulate well

Mixed mode simulation

What’s your favorite simulator?

Simulation with a CPU model included (Did you know Falstad can do that? https://hackaday.com/2021/06/11/circuit-vr-arduino-virtually-meets-analog/ – several others, too)

Hardware in the loop simulation

Quantum simulators

Optimization - gates vs speed vs packages vs ???

You tell me…. What do you want to talk about?

Al Williams12:06 PM
You've heard of hunt and peck? Maybe cut and paste lol

Bil Herd12:07 PM
I "cheat" and use the vendor specific tools such as Altera and Xylinx, what are the open source alteratives?

salec12:07 PM
You compiled your notes, professor!

Dan Maloney12:07 PM
How about a "Best choice for beginners" in logic simulators?

Christoph12:07 PM
oh good evening!

Bil Herd12:07 PM
I submit that Al is really a simulation (ssshhh... don't tell him)

Al Williams12:08 PM
Al or AI?

Al Williams12:08 PM
So...

craigcc.frii12:08 PM
Didn't know Falstad had CPU models, sweet!

Al Williams12:08 PM
I guess the first thing to think about is what you want to accomplish

RichardCollins12:08 PM
I saw recently some apps to pull circuit diagrams from images. Then lots of groups doing SPICE circuit simulations. And lots of videos of beginners (hackers) drawing circuits by hand, and then mumbling half remembered rules for how to calculate basic voltages, currents, couplings and frequencies.

Al Williams12:08 PM
Falstad has the advantage of being no setup. You can even do sort of mixed modes. So for play it isn't bad at all. But serious stuff... maybe not so much.

monsonite12:09 PM
I use H. Neemann's "Digital" simulator - It's takes over from where LogiSim went down.

https://github.com/hneemann/Digital

Al Williams12:09 PM
I am like Bill. If I'm using a device I will use the vendor tools because they have really good models for it.

Ethan Waldo12:09 PM
Falstad could probably get more serious if it were converted to web assembly

Al Williams12:09 PM
Yes I like Digital as well

Digital (outputs HDL): https://github.com/hneemann/Digital (has java components, serial port, CPU, etc.)

Al Williams12:09 PM
Falstad probably is fine like it is for what it is

Al Williams12:09 PM
Great visualization

Al Williams12:10 PM
But if you do anything serious schematic entry is ponderous

Al Williams12:10 PM
When I worked for Motorola we used to literally crawl over the schematics for the 68000 on a giant table in our lab

Al Williams12:10 PM
Honestly would get up on the table and crawl on our hands and knees to read them.

Al Williams12:10 PM
So for anything serious you really want the HDL type simulations

Ethan Waldo12:10 PM
At least you didn't have to draft the transistors by hand....

Al Williams12:11 PM
You had 1s? lol

Al Williams12:11 PM
I will say though Bil

monsonite12:11 PM
Yes - I heard about the table-crawling when they laid out the 6502 at MOS. Clean socks, with no holes essential....

Al Williams12:11 PM
For quick HDL I really love EDAPlayground and we use it in the bootcamps

Al Williams12:11 PM
EDAPlayground: http://edaplayground.com/

Bil Herd12:11 PM
Lol... yes

Al Williams12:12 PM
In browser and access to a lot of commerical-quality and FOSS tools with no setup or install

Al Williams12:12 PM
Again, probably not what you want to base the rest of your career on but very cool

Al Williams12:12 PM
One thing I like about Digital by the way

Bil Herd12:12 PM
looks like a good way to develope or test snippets

Al Williams12:13 PM
is you can draw schematics and get a truth table or start with a truth table and it will do a schematic. Plus you can export VHDL or Verilog

Al Williams12:13 PM
So that's nice because you can start with a simple schematic / logic diagram and then move to verilog

Al Williams12:14 PM
The other nice thing about the vendor tools is they will optimize for the architecture when you build anyway so getting optimal is less important than it used to be... especially since optimal changes depending on what you want

Ethan Waldo12:14 PM
Is the exported VHDL any good or do you find you have to re-work it?

monsonite12:14 PM
Al - any thoughts about hosting a Digital bootcamp, to bring schematics and HDL into a common learning resource?

Al Williams12:14 PM
For example, when I was in school we were taught to get down to all one kind of gate because in those days you probably had one kind of gate you used for everything (discrete transistors). But with SSI like 7400 chips, it was better to use fewer packages

Al Williams12:15 PM
I don't do much with VHDL these days but the Verilog is good enough. I have not tried anything huge with it though

Christoph12:15 PM
any opinion on cypress' PSoC Creator?

Al Williams12:15 PM
I did notice the last release notes from a few weeks ago said that it had some Verilog fixes in it

Dan McDougall joined  the room.12:15 PM

craigcc.frii12:15 PM
I haven't gone all the way thru the boot camps yet, looking to buy some ice40 hw too. At what complexity do the open source tools start to break down?

Al Williams12:16 PM
Bootcamp for Digital... maybe. I wanted to do some more FPGA bootcamps with development of a UART etc but we were getting increasingly small numbers as the bootcamps wet up in number lol

charliex12:16 PM
i really like psoc creator, its one of the rare tools where a primarily hardware company makes decent software

Dan Maloney12:16 PM
Is there any sort of mental break you need to make when using logic simulators to design for FPGA versus when you want to build something from, say, a bunch of 74xx chips?

Al Williams12:16 PM
PSoC... what a great idea. I love the concept but honestly I haven't used the latest gen of the tool suite. For those of you who don't know

Al Williams12:17 PM
PSoC has a CPU (or several) and some uncommitted logic and analog blocks you can configure ... sort of like an FPGA but at a higher level

Al Williams12:17 PM
I think there are a few answers to Dan's question

Al Williams12:17 PM
Verilog is like a knife... it can chop, carve, or stab

Al Williams12:17 PM
So depending on what you want out of it, it can be very little different or very different

Al Williams12:17 PM
As a simulation language you can actually model down to the gate level in Verilog

Bil Herd12:18 PM
I found PSOC usable at least for small stuff.

Al Williams12:18 PM
And you can naively transcribe gates.... and(q,a1,a2,a3);

Al Williams12:18 PM
But the smart money is on telling Verilog what you want and letting the FPGA synthesis figure that out.

Al Williams12:18 PM
So it is like my 7 segment example that I used at the top

Philip12:18 PM
Logic simulation should be independent of whether it's in an FPGA or a pile of TTL. Timing simulation depends on modeling gate delays and interconnect. This is automatically extracted for FPGAs, but not for board of TTL.

charliex12:19 PM
its good for stuff like ws style programmable led /capacitive touch projects since you can implement the WS driver on the block side and not have to struggle with the tight timing and theyre cheap

Al Williams12:19 PM
You could write all the AND OR gates etc. but why? Just describe it. Phillip makes a good point, although I will disagree slightly. In FPGA design there are really two levels of sim

Al Williams12:19 PM
Functional is where you make sure you figured out what you want it to do

Al Williams12:20 PM
But you also do post synthesis simulation to make sure you get timing right and miss race condiditions/metastability and so on

Al Williams12:20 PM
s/condiditions/conditions

Bil Herd12:20 PM
lol

Al Williams12:20 PM
So then it does matter and the gate-level sim makes sense there along with vendor models for temperature and clocking

Ethan Waldo12:21 PM
Have you tried moving any of your FPGA designs in to an ASIC ecosystem like Skywater PDK? If so, what were your biggest challenges?

Al Williams12:21 PM
Speaking of metastability that is one place where many of the tools you commonly use don't work well is at the rough edges. ... so if you have a 2ps glitch or a time of metastabiity

Al Williams12:22 PM
I have not done FPGA to ASIC. I've done ASIC professionally where we go straight from sim to ASIC. You really want your simulations correct then because being wrong can cost you your job or your company lol

Al Williams12:23 PM
Of course, digital is really analog at the bottom and you can simulate with something like LTSpice and it isn't even that hard

RichardCollins12:23 PM
I am reading these, thinking that you are only describing tools for individuals. Tools that require lots of memorization and practice. Tools that do not scale, and tools that are NOT good at collaboration. When you were crawling the 68000, there was a group. Each person did what they were best at, and not all of them were soldering, or editing circuits on the computer, or ordering parts, or trying to raise funds. You really have not said what you want to make. I know of thousands of global scale problems. You are just talking about tools for part of a problem for one person. What about things that matter? Or problems that cut across many people on Hackaday.io?

Al Williams12:23 PM
That lets you set up horrible simulations with analog issues. And do mixed signal.

Bil Herd12:23 PM
Altera supposedly had an FPGA to ASIC program but whenever I asked for details no-one from Altera could speak to it.

Al Williams12:23 PM
For example: LTSpice can simulate digital:

Philip12:24 PM
Functional sim works best in a single clock environment, and static timing analysis is sufficient for verification of meeting timing. Things get way more messy with two or more independent clock domains. FPGA vendor timing models tend to only do worst case timing, ignoring some of the hazards of a best case situation, (for CMOS: high VDD and low temp)

Al Williams12:24 PM
The timing between FPGA and ASIC can be a lot different but you'd think it could work pretty well

charliex12:24 PM
there are some of those neat looking asic/fpga combo chips never used one but from what i understand they have the programmable and dedicated layers going on

Al Williams12:25 PM
We also did a nice set of YouTube videos on LTSpice in general awhile back along with the Circuit VR series

Philip12:25 PM
A serious challenge of migrating from FPGA to ASIC is the constraints system and test vectors (or equiv) may not be compatible.

Al Williams12:25 PM
Yeah well a lot of ASIC is cell based. So instead of a programmable interconnect you basically just do a single layer of metal on top

Al Williams12:26 PM
Yah the contraints in particular. That's one area where it would be nice to have a single ecosystem for both

Bil Herd12:26 PM
I just asked a chip guy using 7nm ASIC and he said they had 22 layers of metal and 76 masks total, way more than the old days

RichardCollins12:26 PM
It is not hard to model digital devices, or systems of any sort - including all the analog elements. And, nowadays, they all depend on software, algorithms, setting goals, and collaboration between people working globally.

Al Williams12:26 PM
Yeah or however many metalization layers you have. All the chips are flipped upside down now too

Bil Herd12:27 PM
also FPGA is constrained by input terms of the LUTs that doesn't necessarily carry over to ASIC.

Bil Herd12:27 PM
or so my memory goes

Discussions