<mcc111[m]>
<adamgreig[m]> "mcc111: https://gist.github.com..." <- Hi, thanks so much for the help— I compiled the exact .pys here and uploaded them to the board. If I upload this FPGA, the LED in the upper right of this image https://github.com/dadamachines/doppler/raw/master/img/dadamachines-doppler-front.png lights up. The LED which is one to the left of it (in the image) appears to be lit at about 50% intensity, though I cannot tell if
<mcc111[m]>
can't tell what it's doing. I could believe this dim light is caused by a gpio being high 1 out of 2 cycles or maybe even 1 out of 24 but not 1 out of 2^24…
<mcc111[m]>
this is because it is strobing on and off very quickly or if there is electrical leakage from the other LED. The documentation on how to program the fpga binary is not super great but I think it succeeded because if I "sabotage" it no light comes on at all. What exactly do you expect this program to do? My skimming without knowing the language yet gives me the sense "aled" should be set high one out of every 2^24 cycles and "kled" I
<charlottia>
mcc111: I'm making assumptions about how the LED matrix anode/cathodes work here, but essentially, holding down the button should cause a LED to strobe every 2^24 cycles.
<charlottia>
(The Counter will increment its count once per cycle. Its overflow will go high only when count == 0, i.e. when it's just overflowed.)
Bluefoxicy has joined #amaranth-lang
<charlottia>
(The first member in aled (which I guess is one of four LED matrix anodes) will go high when the counter's overflow goes high, but only while the button is pressed down. When up, it remains low.)
<charlottia>
* (The first member in aled (which I guess is one of four LED matrix anodes) will go high when the counter's overflow goes high, but only while the button is pressed down. When the button is up, it remains low, as do the others.)
<charlottia>
Having a look at the schematic now to see what this all means. I see now it's a 4x4 LED matrix!
<charlottia>
It looks like they do it slightly differently; they change the output-enable of the kleds instead of changing the output. (This connection is fully made over on lines 26-29.)
<charlottia>
I'll slightly modify Adam's example to see if I can get you any further.
<charlottia>
I don't know what I'm doing with any certainty, but maybe this will work better! This example tries to just light up one LED in the matrix at a time; depressing the button will move to the next one.
<charlottia>
(The button isn't debounced so it'll probably skip a few at a time.)
<charlottia>
Also I might have the column/row terminology reversed, since I didn't read the Arduino example carefully! I guess you can always just rotate the board.
<charlottia>
Please note the platform file changed slightly here too -- we need individually controllable output-enables for all 4 cathodes, so there are four distinct kled resources.
<_whitenotifier-9>
[amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 0dd0778 - Deploying to main from @ amaranth-lang/amaranth@93e89f5632569b06ac5774bedbaf1b5c2106d4c8 🚀
<_whitenotifier-9>
[amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 44b1fa9 - Deploying to main from @ amaranth-lang/amaranth@33139ac6cbf535edf5b16aa3f2477675a2985d3f 🚀
<galibert[m]>
Hey Catherine , since you’re here and I have way too much time to think. Imagine I want to plonk some metadata on devices (think 6502, 6522…) for things like “how well is it working” and retrieve it somehow at “compile” time, should I put it on the Elaboratable (or Component) or on the Module?
Bluefoxicy has quit [Ping timeout: 245 seconds]
Bluefoxicy has joined #amaranth-lang
<whitequark[cis]>
the Module is just a temporary thing that you use for DSL purposes
<whitequark[cis]>
nothing should ever be added on it (and this might be enforced in future with __slots__)
<galibert[m]>
Sure, but will the Elaboratable tree be visible at some point?
<whitequark[cis]>
nope, not unless you make it visible in some other way
<whitequark[cis]>
(neither will be the Module)
<whitequark[cis]>
Amaranth doesn't currently have any concept of user design hierarchy, which is... an issue, actually
<whitequark[cis]>
mostly for probing/debugging
<galibert[m]>
Yeah
<galibert[m]>
So if I rfc on that, would you like it more on Elaboratable or on Module ?
<whitequark[cis]>
neither
<whitequark[cis]>
I don't know that I want to add this before the new middle end lands
SpaceCoaster has quit [Ping timeout: 246 seconds]
SpaceCoaster has joined #amaranth-lang
<galibert[m]>
Sure, that’s a requirement for… well, pretty much all the kind of things I have interest in
<galibert[m]>
If I understand correctly what it entails
<whitequark[cis]>
yeah, an internal netlist representation
<whitequark[cis]>
I'm thinking that I probably want to record every step of elaboration for when this lands
<whitequark[cis]>
i.e. there is a set of netlist entities, and there is the netlist-hierarchy correspondence, and it's a many-to-many one
<mcc111[m]>
<charlottia> "https://gist.github.com/..." <- Hi Charlotte, thanks– I got the same result with this FPGA binary, just the one LED lit up and a second LED half lit. In neither your nor adamgreig's binaries did either of the two buttons do anything.
<mcc111[m]>
What I am trying to figure out right now is *can I program the FPGA at all*, and if I can't program the FPGA is the problem (1) the platform file, (2) the binary compiler in amaranth, (3) the method by which I am uploading the FPGA.
<mcc111[m]>
Since I believe both your and adam's test programs begin the same way (light up one LED, and then on some later time/button signal do something different), I wonder if it might help to construct a program that lights up *some different LED* from the start so I can install it and confirm anything is working at all.
<mcc111[m]>
Update no, charlotte 's program worked and possibly so does adamgrieg's! The problem is I was programming the fpga wrong, because Doppler's documentation is wrong. *_*
<mcc111[m]>
Tested @adamgrieg 's example with (what I now believe to be) the correct programming method and I can't get it to do anything. With the correct programming method all LEDs are blank and holding down a button doesn't change anything I'm not sure how long 2^24 cycles is on this FPGA so I don't know how long I need to be holding it down to see it blink. If that isn't the problem, I assume adam's platform did have some sort of problem
<mcc111[m]>
with the LED specification and charlotte's version fo the platform fixes it.
<mcc111[m]>
I will proceed with charlotte's version since this is enough to start being able to work through the Amaranth manual.
Bluefoxicy has joined #amaranth-lang
<whitequark[cis]>
mcc111: I can take a look at the difference a bit later if you'd like
<mcc111[m]>
whitequark[cis]: That would be helpful! I think something weird might still be going on because I get inconsistent button press behavior from boot to boot but charlotte specifically said she didn't put much into fixing that up.
<mcc111[m]>
(First test I saw "button works, but lacks debouncing" which is what charlotte said and therefore correct, second test I found that the light only moved once per button press with no "bounce" problem BUT it was inconsistent whether the button press worked at all, in order to make it work I needed to wait a second or so between each press and hold the button down for a moment and sometimes even that did nothing. very strange.)
<mcc111[m]>
However like I said my goal was not to get a perfect platform file right now but just to get far enough I can write an amaranth program and be able to tell whether it's properly working on the device.
jevinskie[m] has quit [Quit: Idle timeout reached: 172800s]
Bluefoxicy has quit [Ping timeout: 245 seconds]
Bluefoxicy has joined #amaranth-lang
<adamgreig[m]>
mcc111: glad it's working! I think Charlotte found a specific issue in mine which is the led only turns on for 1 cycle in 2^24 so you won't see anything
<adamgreig[m]>
I wouldn't bother debugging it especially further, just a silly mistake my end from not testing it
<mcc111[m]>
adamgreig[m]: Oh! So I *was* reading the code correctly.
<adamgreig[m]>
(you could change line 33 to drive the led from the top bit of counter instead of from the overflow output and it would probably work)
<_whitenotifier-9>
[amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 0767b26 - Deploying to main from @ amaranth-lang/amaranth@49a56c446790307b25d0c0e7fe0bd5b0cbafe744 🚀