Live data from Hacker News

From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

a1k0n.net

11–20 of 26 posts

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#12
post #6

Going slightly off topic, I was interested to learn from this blog about Tiny Tapeout, the service they've used to order their custom chip design. The concept for anyone as unfamiliar with it as me is that lots of people pay a few hundred dollars each to get a small part of a chip being made, and once it's made they receive the chip ready to use with their section everyone else's, too, with a way to choose which bit…

I got a tile on TinyTapeout9 (I think) and participated in a workshop for it at the Hackaday Supercon last November.

I had a lot of fun. I had a bit of knowledge from my university digital logic class, but really enjoyed learning how the layers are put down and how they make transistors. If you have an opportunity to do it, I strongly recommend it.

There are some very cool things you can do, but you’re limited by the tile size, the inputs provided and it’s worth noting that you get one chip on a module. It’s probably the 2nd step in getting started making a custom ASIC if you wanted to get into that. (The first being learning how to design with logic gates)

bitlui made a VGA Rickroll with it a while ago. [1]

My tile spells out “Aaron” (my first name) on the output to the seven segment display.

I think there is enough room to make a simple microprocessor. Fun if you’ve not ever done something like it.

So, to answer your question - yes it could be useful if you had a very specific thing you wanted to do that made sense in silicon. You could buy extra tiles and get space. That said, it’s mostly educational. But worth it if you have an interest.

[1] https://youtu.be/DdF_nzMW_i8

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#13

When are you going to post part 3 of your Hacker Challenge? It's been fifteen years and we're still waiting. Thanks.

lmao! that was so cringe I unlisted it from the main index. who is "we"?

part 3 is to find the secp256k1 private key for satoshi's bitcoins

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#14
post #3

The thing about donut.c is that its source code is shaped like a donut, that’s a huge part of its charm. While altering it to use shifts and adds is a fun exercise, since its source code is no longer shaped like the donut it renders, I would argue that a large part of its charm has disappeared and it’s no longer a donut.c

It’s trivial to reformat the source code into a donut shape.

We need someone to write pastry.c which takes any C file and reorganizes the code into the shape of delicious bakery products.

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#15
post #6

Going slightly off topic, I was interested to learn from this blog about Tiny Tapeout, the service they've used to order their custom chip design. The concept for anyone as unfamiliar with it as me is that lots of people pay a few hundred dollars each to get a small part of a chip being made, and once it's made they receive the chip ready to use with their section everyone else's, too, with a way to choose which bit…

Almost anything you can do on Tiny Tapeout your can do on an FPGA and test it today (not wait 6-9 months to get silicon back) - if you are laying polygons yourself because you want to test out some novel circuit that TT is potentially a great idea.

On the other hand if you've learned logic design and want to spread your wings and make some real chips then TT is an educational experience - not only is the tooling different but often you need to understand stuff in depth that FPGA tooling kind of hides (because essentially FPGAs come pre routed) so it's a great way to take a small step into silicon design.

There's probably a large bunch of people who will make just one design because they can, just to say they did it.

I've taped out 4 CPUs on TT, I'm retired, I used to do chip design, TT has the same sort of scope as the logic blocks I was making 20 years ago - no one is going to be using it for manufacturing (you get just 1 die back)

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#16
post #3

The thing about donut.c is that its source code is shaped like a donut, that’s a huge part of its charm. While altering it to use shifts and adds is a fun exercise, since its source code is no longer shaped like the donut it renders, I would argue that a large part of its charm has disappeared and it’s no longer a donut.c

It’s trivial to reformat the source code into a donut shape.

mmmmm.. trivial donuts...

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#18

Earlier quoted context omitted.

It’s trivial to reformat the source code into a donut shape.

Non-trivial, IMHO - automating it sounds non trivial, and doing by hand is quite non-trivial, right? We gotta go make hand edits line by line?

For a language like C, I would describe the formatting process as "straightforward" as opposed to "trivial". It's straightforward in that it feels very mechanical, but not trivial in the sense that it's difficult to fully automate the process. (The mechanical part is inserting spaces at the right places, the not so mechanical part is swapping tokens and rewriting expressions so that things line up).

You can see an example recording here of how it's done:

https://www.ioccc.org/2019/yang/obfuscation.html

First half of it is writing and golfing, second half is the formatting bits.

For languages like Perl and Ruby, the formatting process is easily automated and mostly trivial.

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#19

Earlier quoted context omitted.

Non-trivial, IMHO - automating it sounds non trivial, and doing by hand is quite non-trivial, right? We gotta go make hand edits line by line?

For a language like C, I would describe the formatting process as "straightforward" as opposed to "trivial". It's straightforward in that it feels very mechanical, but not trivial in the sense that it's difficult to fully automate the process. (The mechanical part is inserting spaces at the right places, the not so mechanical part is swapping tokens and rewriting expressions so that things line up). You can see an ex…

That visualizer is incredible, appreciate it and the insight - and 4 hours! Wow.

Re: From ASCII to ASIC: Porting donut.c to a tiny slice of silicon

#20

I've been deeply curious about the sort of speedup you get from doing what was in software, on hardware: I know the chips hasn't been delivered yet, but, the statements at the beginning re: we can expect a new frame every N nanoseconds, give me hope there's a rough heuristic for what speedup we'd expect in this particular case. Do we have a rough* understanding of what the speedup will be? * Within 2 OOMs

Speedup compared to what? You can’t compare it to doing it in software on the same machine. So, you need to pick a reference CPU.

Finding a somewhat comparable CPU would be challenging. It would need to run at around 48 MHz and have 16 bit integer addition. I think the fastest Z80 clone would be a candidate (https://en.wikipedia.org/wiki/Zilog_eZ80), but that’s a pipelined CPU. You may find that unfair.

If you don’t pick something comparable but just something cheap, given the 48MHz clock of this hardware and the limited amount of parallelism, it wouldn’t surprise me if the typical modern smartphone could do it faster, even without the use of a GPU.

Post reply on HN