HNHacker News
TopNewBestAskShowJobs

FPGAhacker

2,646 karma · joined January 14, 2018

submissionscomments
FPGAhacker··on Designing a MIPS CPU in Hardcaml
I'm enjoying this series. I've got a few comments about inaccuracies:

> Vivado, the dominant IDE for hardware design

I haven't heard that one before. I use it when I'm working with Xilinx parts, but I rarely open the GUI. I use VSCode mainly, and nvim.

Xilinx has come a long way with Vivado from its roots, but I'd never actually do day to day work in it, for the same reasons I wouldn't work in eclipse.

> Want to write code in a different editor like VSCode? Alright, but you'll need to manually register every new file you make in Vivado.

It is pretty straight forward to automate with a general script for this and you never deal with it again.

> Oh, and there's no syntax error highlighting in VSCode's Verilog extensions either.

This is not true.

https://marketplace.visualstudio.com/items?itemName=mshr-h.V...

https://marketplace.visualstudio.com/items?itemName=eirikpre...

> On the rare occasions you do get errors/warnings

Synthesis is notorious for barfing out thousands of warnings even on simple designs. I have never considered them rare, or heard someone else call them "rare," until this blog series.

Quite the opposite. We are inundated with so many warnings that people start to ignore them and that leads to problems. Vivado even invented "critical warnings" to try help with the situation.

> a friend and I once spent over an hour debugging an issue, only to find out that I mispelled a wire name.

This one has me puzzled. Did they misspell it such that it looked like another declared signal?

> The synthesis process doesn't throw error in cases where you would expect it to [...] You can have multiple modules / circuits outputting to the same wire.

You might expect that to be an error, but it's called a "wired-OR." It's often a mistake so you will definitely get warnings about it, but it's not wrong. Go back and look at transistor diagrams of gates.

> You can pass wires into a module by name, but it won't error if a wire is missing, misnamed, etc.

It's true that it won't error if one is missing, because it's not strictly wrong to do that. You will get warnings about undriven logic though.

It's hard to envision a scenario where something misnamed doesn't cause an error unless you typo it into another signal name.

You definitely will get errors trying to connect to a port that doesn't exist.

> You can pass a 1-bit wire to a 5-bit port on a module (or any other mismatched combination).

This is true. And if you aren't aware of it you can get into trouble. I had a friend run into this issue last week, mainly because he came from VHDL which (like ADA) is very strongly typed.

> Explicitly extending/truncating signals is already possible by making a module to transform your input/output, so I'm not sure why this implicit conversion should be allowed.

It's a reaction to VHDL (based on ADA), which with its extreme typing made arithmetic difficult to do. Verilog was intended to be more like C.

> Hardcaml really interesting because OCaml is functional, compiled, and statically typed. Also (and somewhat more importantly), Hardcaml supports testing

Ok, I think it's cool to try other languages and to branch out. I've tinkered with an HDL based on Clojure. But the post implies Verilog does not support those things..

Verilog supports testing trivially. It is statically typed, albeit weakly in some cases. It clearly is functional.

But the semantics get clunky. I would think that is where OCaml or Chisel or others would be interesting.

> On the rare occasions you do get errors/warnings, they're generally cryptic and require relatively deep understanding of Verilog. Not great for beginners.

This is true. I find it annoying about most languages I work with, most recently python.

> Tooling sucks. All the synthesis errors I complained about above could be identified through static analysis and surfaced as warnings/errors in the editor. Emphasis on *could be.*

Yes, it does suck. I'm hopeful for things like symbiflow and the tooling it's based on.

But to be fair, static analysis is very much a part of digital design. It's often called Formal.

> Tests also have to be Verilog modules, whereas usually in software it's preferable to use functions/methods for test cases.

I don't really understand what this point is. Your top level has to be a module (or a program) ... it's a fundamental unit Verilog. You can put all the functions/tasks you want in that module.

It's like complaining about classes in c++?

> Partially as a consequence of the previous point, testing requires a lot of boilerplate

That really depends on what level of testing you are doing. You can do the simple function/task based testing, and that is nearly zero boiler plate.

> There isn't really an ecosystem for things like continuous integration. For that matter, many testing innovations from the software world (like mocks/stubs) don't seem to carry over well to hardware.

I don't really get this either. Mocking and Stubs are an incremental design technique. They work fine. And all of my development and that of my team happens through gitlab-CI.

> A lot of automated testing seems to be based around printing assertions and generating waveforms in the Vivado console/waveform viewer. That's not very automatable.

I don't really know what this is talking about. I don't do testing with vivado... it's a compiler/synthesizer for me.

I think the real problem here is that tools are expensive for digital design (hopefully symbiflow/yosys et al get serious traction and change this). If you are stuck in vivado, maybe you can't do automated testing? I find it hard to believe.

ok, now that I'm done complaining about the blog post's complaints, on to the good stuff (I hope) re Hardcaml.

FPGAhacker··on DJI Mavic 3 Drone
Definitely this. Use a simulator for a while first.
FPGAhacker··on Do-nothing scripting: the key to gradual automation (2019)
So the idea is that eventually real work will be done, likely by adding more functions. The class provides a nice encapsulation for that future work.
FPGAhacker··on High-Level Synthesis for RISC-V
I can agree with verbosity. But VHDL has an extremely strong type system, which comes from its ADA heritage. It’s semantics are also very consistent per my recollection, but it’s been a while.

Verilog definitely has looser numeric typing. It tripped up a friend of mine yesterday. I’ve been doing this stuff forever so I don’t think about it much, and I’m grateful for the simplified math it affords.

Disagree on IDE support because vscode support for SV at least is pretty nice. And sigasi is still doing well. But I’m old school I guess and prefer vim/nvim. I actually do a hybrid thing where I’ll use nvim in the vscode terminal to do some quick edits for something not In the workspace every now and then.

SystemVerilog smoothed over some of the ugliness of verilog, but then bolted on at least three other languages into one with the semantic inconsistencies you mention. Particularly No idea what the rational was there, if any.

But I never found it to be a significant barrier to learning. I’ve done experiments with writing an HDL in Clojure that would compile to SV, and it was fun, but it just created a new set of problems. Much better to work in a standardized language warts and all.

FPGAhacker··on High-Level Synthesis for RISC-V
Curious, what do you find so bad about them?
FPGAhacker··on Candlestick Makers' Petition (1845)
seems like the seed of an argument against disposable goods.
FPGAhacker··on Ask HN: If you could rebrand Facebook, what would it be?
Mind trap
FPGAhacker··on The FDA wants you to be able to buy a hearing aid without a prescription
There are actually a good reasons not to do this. A very large part of your hearing is brain training...your brain learning how to interpret the new stimulus it is getting. You need to give your brain time to adapt to new stimulus before evaluating whether you are hearing better or not. If you are constantly fiddling with your hearing aids, you never get the benefit of training.

This may not apply if your hearing loss was sudden, but many people get hearing aids only after years of decline. Your brain adapts to what it has available and you learn to hear as best you can with the limited stimulus. When you finally get hearing aids, it feels like your ears have been unblocked.

When it comes to interpreting speech though, especially in noisy circumstances, you have to give it time. Your brain isn't used to using the extra stimulus to interpret speech. In fact, it may have gotten used to hearing loss filtering out background noise and you may initially find all the stimulus makes it harder to interpret speech because of all the background noise you now hear that you previously didn't.

If you don't have patience and start immediately futzing with volume all the time, you never give your brain a chance to adapt, and will be very dissatisfied.

FPGAhacker··on William Shatner is now oldest ever to go to space:'The most profound experience'
Ever see nascar?
FPGAhacker··on The 100 MHz 6502
It really depends on how many steps down the ladder of abstraction you go. Computers are still magic if you step down a few more rungs.
FPGAhacker··on Rancher Desktop, a Docker Desktop Replacement
> Not every widely-used tool needs to be a VC-powered unicorn startup.

Ok, which tools need to be a VC powered unicorn? I’m serious.

FPGAhacker··on Thoughts on chess improvement, after gaining 600 points in 6 months
So I don’t mean this is to be snarky , but aren’t all chess games decided by mistakes?
FPGAhacker··on Investigators say they've finally identified the Zodiac Killer
That’s fascinating to me. How would you describe your dreams (as in rem sleep dreams)?
FPGAhacker··on Curiosity Is Better Than Being Smart?
And then there is the brand of naivety where people chew on tide pods. I suppose they might be happy too.
FPGAhacker··on Time machine: Solaris 2.6 on QEMU
> CDE is alive and well

wow. That's a blast from the past. That was the desktop environment on our unix boxes back when I started asic design. I think it was hpux. But CDE...those screenshots immediately took me way back.

I'm going to have to get that installed at work now.

FPGAhacker··on Always-on Processor magic: How Find My works while iPhone is powered off
Personally I find it rare to actually call someone, so a flip phone would be mostly useless to me. I suppose texting is still a thing though.
FPGAhacker··on Always-on Processor magic: How Find My works while iPhone is powered off
Yes, exactly. Many of the things I’ve seen mentioned in the comments, such as wake on motion or responding to “hey Siri” are waking from sleep. AFAIK, you can’t power on via motion or hey Siri.
FPGAhacker··on Apple didn't revolutionize power supplies; new transistors did (2012)
The article is neither making or debunking that claim. It is debunking the claim that apple revolutionized computer power supplies by borrowing the switching power supply design used in oscilloscopes. It’s the second sentence of the post.
FPGAhacker··on Chicken Scheme
To me, clojure fits that bill.
FPGAhacker··on A DIY E-bike Conversion on the Cheap
Doesn’t sound like a good idea to me… a malfunctioning battery would turn that into a blowtorch aimed at your nether regions.
FPGAhacker··on San Jose Fire had an impossibly complex incident scene (2019)
It’s generally not a good idea to close a high power, high voltage circuit with a live human.
FPGAhacker··on How green is blue hydrogen?
> I’m struggling to see the problem here.

The demand curve would push out dramatically.

FPGAhacker··on RunAsDate – Run a program with the specified date/time (2019)
Among other things, I assume for testing your code with date handling edge cases like leap years, leap seconds, 2038, etc.
FPGAhacker··on What it was like developing for NES back in 1990
And how would one know the bit was set... polling?
FPGAhacker··on New in Git: switch and restore
I see command line switches as an api, and it feels wrong to me to keep aggregating new things without a clean break.

I feel like these things should be versioned in some fashion. Perhaps come up with a clean slate api and enable it via calling git2 or git3 instead of this terrible mish-mash where new commands are constrained by previous bad decisions.

Of course this is not a novel idea, and people attempt this by making their own veneer with a different name… but this has to come from the top for it to be effective. People won’t en masse bother with git2 or git3 if it is not built into the mainline distribution.

I guess I should give it a try a submit a patch.

FPGAhacker··on Live Starlink Satellite Map
So we should be comfortable with billions.
FPGAhacker··on Why we're blind to the color blue
From atmospheric distortion they can appear to flicker, or “twinkle” as the song goes.
FPGAhacker··on Steve Wozniak speaks on Right to Repair [video]
I use apple mainly now, but my dell repair experiences were fantastic. They always sent a tech to me to do the repair. Support was always my #1 reason for choosing dell.
FPGAhacker··on European Citizen's Initiative for UBI
They are talking about dilution.
FPGAhacker··on FCC reaffirms $3M fine for marketing unauthorized drone transmitters
I think the obvious difference is design intent.
← PreviousPage 8 of 23Next →