<ZipCPU|Laptop>
The only simplification is changing (AB)->C to (!A)||(!B)||(C)
<ZipCPU|Laptop>
Within my own logic, I just wrote all 8 of the checks out.
<promach_>
I see
<promach_>
let me try your suggestion later. I need to go now. I shall come back to this in an hour or two
promach_ has quit [Ping timeout: 264 seconds]
cemerick_ has joined #yosys
dys has quit [Ping timeout: 264 seconds]
digshadow has joined #yosys
promach has joined #yosys
m_w has quit [Ping timeout: 264 seconds]
<promach>
ZipCPU , ZipCPU|Laptop : changing (AB)->C to (!A)||(!B)||(C) I do not understand the second logical OR operator
<ZipCPU|Laptop>
!(AB) = (!A)||(!B), right?
<promach>
I suppose we should use logical AND operator instead ?
<promach>
no mean for C
<promach>
no, I mean for C
<ZipCPU|Laptop>
if(A) then (C) is only ever false if (A) and (!C) are true.
<ZipCPU|Laptop>
Hence, you can replace if (A) then (C) with (!A)||(C)
<ZipCPU|Laptop>
Hence, an expression like if (PIGS_FLY) then (POLITICIANS_ARE_HONEST) will be trivially true for all politicians.
<promach>
ok
<cr1901_modern>
Hah.
* cr1901_modern
is amused but can't muster up a better response tonight- ENOENERGY
cemerick_ has quit [Ping timeout: 260 seconds]
jkiv has quit [Ping timeout: 256 seconds]
jkiv has joined #yosys
cemerick_ has joined #yosys
xrexeon_ has quit [Remote host closed the connection]
heath has quit [Ping timeout: 256 seconds]
heath has joined #yosys
ZipCPU|Laptop has quit [Ping timeout: 256 seconds]
heath has quit [Ping timeout: 248 seconds]
heath has joined #yosys
pie_ has quit [Ping timeout: 248 seconds]
jkiv has quit [Remote host closed the connection]
jkiv has joined #yosys
m_w has joined #yosys
cemerick_ is now known as cemerick
Exaeta has joined #yosys
<Exaeta>
Hello. I want to develop for FPGA on linux. What FPGA should I buy for under $400?
<ZipCPU>
Exaeta has a question for all of you ice40 types: what's a good beginners ice40
<ZipCPU>
I suggested an 8k part of some type.
<ZipCPU>
I have an icoBoard, a blackICE board, and a TinyFPGA board. I'm hesitant to recommend any of these because I'm not sure how mainstream they are.
<Exaeta>
Where do you buy these btw? Amazon doesn't have a large selection
<ZipCPU>
Check out Trenz Electronics for some of these.
<ZipCPU>
But ... I thought there was a pretty good Ice Stick eval board, and I'm hoping someone else on the channel can remind me of what it was.
<Exaeta>
I'm curious what's the most powerful FPGA that works with yosys/open source
<Exaeta>
I want to make a 16-bit cpu
<ZipCPU>
Then you'll definitely want the 8k part.
<ZipCPU>
While you can build a CPU in the 1k part, you'll find yourself very limited.
<ZipCPU>
I've managed to fit the ZipCPU on the 8k part tho.
<ZipCPU>
(ZipCPU is a 32-bit CPU, with two sets of 16 32-bit registers)
<Exaeta>
ZipCPU: so you made your own CPU? how fast is it compared to intel cpus?
<ZipCPU>
Lol!
<Exaeta>
slow? haha
<ZipCPU>
FPGA's don't run as fast as custom designed chips. I think the rule of thumb is that there's an order of magnitude speed difference between the two.
<ZipCPU>
The fastest I've run the ZipCPU is about 100MHz.
<ZipCPU>
I built one design for 150MHz or so (I was pushing for 200), but the project stopped when the peripherals wouldn't support the speed I wanted.
<Exaeta>
ZipCPU: so a minimum of 10x slower excluding instruction set advantages?
<ZipCPU>
Well, yeah but ...
<Exaeta>
or like 100x? humm
<ZipCPU>
You can "buy" speed with FPGA logic.
<Exaeta>
why are FPGA so much slower?
<ZipCPU>
So you might find that a bigger FPGA is faster than a smaller one.
<ZipCPU>
So the comparison is between "FPGA"s and "ASIC"s.
<ZipCPU>
FPGA's are slower than ASICs because they have to be so general purpose.
<awygle>
Exaeta: i'm guessing you ended up here through learning about the icestorm project, but is an open source toolchain actually important to you? or do you just want to devleop for FPGAs on Linux?
<Exaeta>
awygle: I mean, I prefer open source. but I guess it depends on the performance differences
<sorear>
the logic elements in an FPGA are much further apart, which makes your timing worse by about a factor of 10; i'd be curious to know more about how sram and flash fpgas compare to ASICs in terms of energy per operation
<jkiv>
I started with the Lattice ice40hx8k development board and it's been pretty good.
<sorear>
i assume "much worse" but I couldn't guess if 10x or 1000x
<jkiv>
Exaeta, it came with a cable. It's the larger mini type
* ZipCPU
is quite tired. If he issues a WAIT instruction, he'll switch to SLEEP mode until the morning alarm INTERRUPT.
* awygle
claims awgle as his own
<Exaeta>
4x isn't that bad
<Exaeta>
I think I'll stick with the open source version
<awygle>
sounds good :)
<Exaeta>
another question
<Exaeta>
can I write the program to an FPGA where it will store it in memory?
<Exaeta>
or does it always need to be connected to the computer?
<ZipCPU>
Exaeta: I think you have your terms confused.
<ZipCPU>
FPGA's don't run programs, CPU's do.
<awygle>
most FPGAs are SRAM-based and lose their configuration when power is removed. they can be loaded over JTAG (which is what you do with the usb connector), or they can read it from a discrete Flash chip on the board (which can also be programmed over the same JTAG link, in most cases). i'm not sure if the Lattice board has a flash chip but i'd expect it does
<ZipCPU>
An FPGA developer will create a "design", which can then be loaded into an onboard "configuration"
<awygle>
update: it does have such a flash chip.
<Exaeta>
Can I write to the flash chip with open source tools?
<ZipCPU>
I certainly do.
<awygle>
good question. i'm going to say "probably"
<jkiv>
Exaeta, the board I mentioned earlier does both -- can store your config, or require reprogramming on power cycle
<awygle>
ZipCPU knows better than me lol
<ZipCPU>
Whether or not the tools I work with would work for your board, I wouldn't know.
seldridge has quit [Ping timeout: 256 seconds]
<sorear>
the lattice and xilinx fpga chips always require reconfiguration after a power cycle. sometimes they can do it automatically.
<awygle>
sorear: well, lattice does have some (XO2) with internal nonvolatile storage
<awygle>
they barely count as fpgas though
<sorear>
in what sense do they barely count
ZipCPU has quit [Ping timeout: 260 seconds]
<awygle>
actually, i rescind that. i remembered them as having hundreds of LUTs and being more like CPLDs, but apparently i was wrong.
heath has quit [Ping timeout: 240 seconds]
<sorear>
what's the dividing line between cpld and fpga
<awygle>
a question of some debate, but the best explanation i've found is that FPGAs are based on LUTs+FFs and a routing fabric while CPLDs are based on product terms. rqou explained it better at one point.
<awygle>
*product terms and a crossbar
heath has joined #yosys
<Exaeta>
ok so... I need to do... something... uh
<Exaeta>
which should I get?
<Exaeta>
lol
<jkiv>
Exaeta, what's up?
<jkiv>
haha
<Exaeta>
I want one that keeps config
ZipCPU has joined #yosys
<Exaeta>
without having to have an attached cpu
<Exaeta>
so I can make like, a mini cpu thing
<Exaeta>
(wouldn't be very useful if it had to be connected to a PC as well)
<sorear>
most SRAM FPGAs support being connected to a flash chip so that they automatically configure themselves from the flash chip on power-on with no other support needed
<Exaeta>
I think it's because I had to edit the makefile?
<Exaeta>
I only changed it to clang-3.8 and clang++-3.8 and from -Os to -O2 though
<ZipCPU>
Sigh ... you did what? Tell me in the morning ...
<jkiv>
Exaeta, I've been playing with the ICE40HX8K-B-EVN and I'd recommend it for toying around. But it'll depend on what your final goal is which device/board is best.
<awygle>
not necessarily. it depends on how much structure is preserved in the transformation to LLVM. i'm guessing that by the time you get LLVM IR things are already in a pretty simulation-optimized form.
<awygle>
if i was going to try to use GHDL i'd probably pay an Ada person to hook in at the AST level, or get a GHDL developer to add AST serialization
<philtor>
or become an ADA person :)
<awygle>
or whatever their immediately-pre-codegen format is called
<awygle>
well, there's always that option :) but my days are full enough
<philtor>
So by simulation-optimized you're saying that it's not synthesis-optimal?
<awygle>
and i have the impression that ADA is like Lisp, where the people who love it are just happy to have a chance to write it
<awygle>
that's my guess, yes
<philtor>
Ada has it's strong points
<philtor>
ranged types, for example
<philtor>
not many languages have that
<awygle>
LLVM IR is pretty close to assembly language, meaning it's very CPU-centric and probably doesn't preserve a lot of structure. but again, i haven't actually looked at GHDL
<philtor>
I asked because I just ordered a BlackIceII board
<philtor>
and I tend to prefer VHDL
<philtor>
anybody else got a BlackIceII board?
jwhitmore_ has quit [Ping timeout: 248 seconds]
<philtor>
Thought I'd give Yosys a try
<philtor>
It's pretty amazing that there's an open source end-to-end synthesis/bitstream creation solution out there now
m_w_ has joined #yosys
<philtor>
I recall having discussions about creating such a thing a dozen years or so ago and everyone was skiddish about reverse engineering bitstream formats
<philtor>
due to potential lawsuits from the FPGA companies
tinyfpga has joined #yosys
brandonz has quit [Ping timeout: 256 seconds]
rqou has quit [Ping timeout: 276 seconds]
m_w has quit [Ping timeout: 256 seconds]
cemerick has joined #yosys
cemerick_ has quit [Ping timeout: 240 seconds]
sklv has joined #yosys
GuzTech has joined #yosys
m_t has joined #yosys
mbock has quit [Quit: Leaving.]
cemerick has quit [Ping timeout: 256 seconds]
sorear_ has joined #yosys
jeandet_ has joined #yosys
bubble_buster_ has joined #yosys
guan_ has joined #yosys
nrossi[m] has quit [*.net *.split]
Kooda has quit [*.net *.split]
jeandet has quit [*.net *.split]
Exaeta has quit [*.net *.split]
sorear has quit [*.net *.split]
guan has quit [*.net *.split]
bubble_buster has quit [*.net *.split]
bluesceada has quit [*.net *.split]
sorear_ is now known as sorear
jeandet_ is now known as jeandet
bubble_buster_ is now known as bubble_buster
guan_ is now known as guan
bluesceada has joined #yosys
Exaeta has joined #yosys
Kooda has joined #yosys
nrossi[m] has joined #yosys
jwhitmore_ has joined #yosys
davos has joined #yosys
pie_ has joined #yosys
davos has quit [Client Quit]
mbock has joined #yosys
dys has joined #yosys
mbock has quit [Quit: Leaving.]
pie__ has joined #yosys
pie_ has quit [Remote host closed the connection]
m_w_ has quit [Quit: Leaving]
m_w has joined #yosys
mbock has joined #yosys
leviathan has quit [Read error: Connection reset by peer]
jwhitmore_ has quit [Remote host closed the connection]
<Exaeta>
How much does it cost to get an ASIC made?
<Exaeta>
Like if I wanted to go from FPGA to real CPU
<Exaeta>
(not that I'm anywhere near that)
<awygle>
Exaeta: Lots(TM)
<awygle>
think 7 figures to start
<awygle>
in theory you can get a small batch made on a Multi-Project Wafer for much less
<awygle>
but if you want to do, like, production, Lots
<Exaeta>
ZipCPU: does the ZipCPU implement instruction pipelining or speculative execution?
<Exaeta>
awygle: how much for like, 2-5 ish cpus?
<ZipCPU>
Yes, it implements instruction pipelining.
<Exaeta>
I don't really care if it's like, 40nm
<ZipCPU>
As such, it runs up to 4 instructions ahead of write back. However, memory is not accessed speculatively by design.
<Exaeta>
ZipCPU: yep. I have some ideas for a CPU right now
<philtor>
Exaeta: Some Universities have fascilities to make some chips - they're gonna be a very old process
<philtor>
Exaeta: but you might partner with someone in such a place to get a chip made
<Exaeta>
ZipCPU: do you know if it's better to make a triple-adder unit or chain two full adders to add three numbers together?
<Exaeta>
not that I have yosys working yet
<philtor>
Exaeta: I worked at a very small startup that was prototyping in an FPGA. The CEO spent most of his time trying to raise funding for us to spin an ASIC... he never did.
<Exaeta>
yeah I think that it'd be easier to funnel money from something else towards making an ASIC .-.
<Exaeta>
I'd like to one day create like a GPU with open source drivers that can compete with Nvidia and whatnot.
<philtor>
there are some open source GPU projects out there
<Exaeta>
I need to get a handle on development first
<Exaeta>
I'll work on learning verilog first and then worry about projects.
<Exaeta>
My first goal is to make a CPU on fpga
<Exaeta>
Does anyone know how to find the hardward clock on the TQ144?
<awygle>
Exaeta: can i ask why a CPU is your goal?
<awygle>
(just curious)
<philtor>
also, if you're just trying to get a CPU running in an FPGA for educational purposes, why not RISC-V?'
<Exaeta>
If I can learn to make a CPU it open up options if the process becomes cheaper or somesuch. GPUs and CPUs are very similar in concept.
<philtor>
What about a specialized Deep Learning chip? All the rage these days.
<Exaeta>
That's very outside my area of expertise.
<Exaeta>
And outside my area of talent
<cr1901_modern>
Machine learning requires floating point IME. A floating point core is not something you do for a hobby.
<Exaeta>
I made a full adder in my computer architecture class without writing a schematic, just plugging wires together, and it worked.
<philtor>
Lots of vector adds & multiplies
<Exaeta>
My cpu doesn't need to have floating point support
<philtor>
cr1901_modern: You can get very good results with fixed point
<philtor>
I've worked on a couple of projects where we did FP
<philtor>
with good results
<philtor>
turns out DL doesn't need high precision
<Exaeta>
anyway
<cr1901_modern>
But both are a PITA (fixed point much less so)
<cr1901_modern>
I'm wary of fixed point b/c once your invariants are violated that your intermediate calculations don't exceed a certain magnitude, you have to redesign.
<philtor>
In fact, the newer NVDA GPUs introduced a 16 bit floating point because 32bit was overkill
<Exaeta>
anyone know what the hardware clock pin on HX1K TQ144 is ?
<philtor>
cr1901_modern: lots of modelling up front
<Exaeta>
also the yosys build thingy doesn't seem to know the pin names
<philtor>
cr1901_modern: lots of simulating (in your software model) how big your numbers get
<philtor>
(where I say we used FP, I mean we used fixed point)
<cr1901_modern>
It may be 16-bit, but it's still floating point, nasty edge cases and all. A floating point core is not something you do for a hobby. <-- hyperbole of course, if you want to do it for fun, go for it! Just be aware it's work
<philtor>
cr1901_modern: sure, my point being that lower precision is quite acceptable
<philtor>
lower precision in fixed point too
<Exaeta>
this is quite a problem. I can't even build blinky :/
<philtor>
I did an SVM project years ago where I only needed 5 bits of precision
<philtor>
Used a lookup table for the gaussian kernel - only needed 64 entries to get as good of results as the C golden program.
<philtor>
ended up with a really small FPGA implementation
<philtor>
but that was all determined by software modeling up front
<cr1901_modern>
Do you still have the project?
<philtor>
I'd really have to dig around
<philtor>
I'm sure it's somewhere, but this was in like 2004
<philtor>
a move and a dead laptop in the meantime
<cr1901_modern>
Ack, just wondering
<philtor>
University project
<cr1901_modern>
Mainly curious about the core's inputs and outputs
<ZipCPU>
Exaeta: First step to any project: get the schematics.
<ZipCPU>
Actually, clktest was what I used for figuring out the clock rate on my icoBoard --- also an iCE40 based board
<Exaeta>
Discera 12Mhz MEMS oscillator <- so my board is doing 12MHz... not very fast huh
cemerick has quit [Ping timeout: 264 seconds]
<ZipCPU>
That plus a PLL gets you any speed you need.
<ZipCPU>
icepll will help you choose you PLL settings.
<Exaeta>
ZipCPU: is there a way to read input/output over usb?
<Exaeta>
like how would I transfer data from pc to ice and vise versa?
<ZipCPU>
Most boards have a USB<->UART chip on them made by FTDI.
<ZipCPU>
If you have this sort of solution on your board, all you need to do is run a serial port on your board, and read it with your terminal program on your PC.
<Exaeta>
For right now, I'd like to get it set up where I can transfer e.g. 4 32-bit integers to the board, and then get a result back, so I can practice verilog
<Exaeta>
It was pretty hard for me to get blinky working... I don't think I'll be able to convert that to work on this chip... lol
<Exaeta>
maybe I should just wait until I have the same device
<awygle>
ZipCPU: have you ever added (e.g.) LZ4 to your debug bus for increased bandwidth?
<ZipCPU>
You got it working on your first day? Not bad. Things can get much worse when working with FPGA's. :)
<ZipCPU>
No, never LZ4.
<ZipCPU>
Although I have added a basic compression.
<ZipCPU>
The trick is, any new piece of software that connects to the port needs to be able to start the compression system from scratch, and ...
<ZipCPU>
the FPGA doesn't necessarily know when that takes place.
<awygle>
i see what you mean
<ZipCPU>
The biggest problem with the dbgbus I presented on zipcpu.com is it only uses 4-bits per character. On my favorite one, I'm still only using 6-bits per character. I'd like to move up to seven, just haven't had the opportunity.
<ZipCPU>
... or <gasp> even 8-bits per character!
<awygle>
i have an old project that used SLIP (Serial Line Internet Protocol)
<awygle>
i am tempted to do that for my upcoming debugging bus
<ZipCPU>
That's a completely different protocol though, with different requirements.
<ZipCPU>
On the other hand, you might find that, if you can use SLIP for a debugging bus, transitioning to using an ethernet port for debugging becomes even easier.
pie__ has quit [Ping timeout: 264 seconds]
cemerick_ has quit [Ping timeout: 260 seconds]
<awygle>
that was my thought, yes
<awygle>
on some level it's all a socket, same tools in call cases
eduardo_ has joined #yosys
eduardo__ has quit [Ping timeout: 276 seconds]
<Exaeta>
ZipCPU: does your CPU have like, MMU type thing?
<Exaeta>
where you can have supervisor/os mode and normal mode?