vak: (Default)
[personal profile] vak
Прикольный проект: позволяет программировать микроконтроллер RP2040 на языке Verilog. Для компиляции в Си используется Verilator.

https://github.com/tvlad1234/FakePGA

Так выглядит мигание светодиодом, верхний модуль:
`include "sr_latch.v"
`include "blinker.v"

module top (
input i_clk,
input i_s,
input i_r,
output o_led
);

wire latchQ;
wire latchNotQ;
sr_latch myLatch(i_s, i_r, latchQ, latchNotQ);

wire blinkOut;
blinker myBlinker(i_clk, blinkOut);

assign o_led = blinkOut * latchQ;

endmodule
Сигналы привязываются к ножкам микросхемы посредством файла конфигурации:
// Clock frequency in Hz
CLOCK_FREQ 5000;

// Input mapping
INPUTS
{
ADD_IN{TOP i_s, 14, PULLUP}; // Maps port i_s to GPIO14 and pulls it up
ADD_IN{TOP i_r, 15, PULLUP}; // Maps port i_r to GPIO15 and pulls it up
}

// Output mapping
OUTPUTS
{
ADD_OUT{TOP o_led, PICO_DEFAULT_LED_PIN}; // Maps port o_led to the default LED pin
}
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org