1
0
mirror of https://github.com/antonblanchard/chiselwatt.git synced 2026-01-11 23:53:33 +00:00
Carlos de Paula 7f79b67019 Add support for Microsemi Polarfire FPGA
This PR adds support for Polarfire FPGA from Microchip/Microsemi.
The support has also been added to Fusesoc .core file to use the
soon-to-be merged Libero backend.

- Due to a tool incompatibility, Libero does not accept a module
named "pll". Due to this, I've renamed the PLLs to Chiselwatt_pll.
- Fixed formatting for chiselwatt.core file according to YAML lexer.
- Added micropython and helloworls filesets to .core so it's possible to
override the .hex to be used on core generation.

Demo of hello_world and Micropython:
https://twitter.com/carlosedp/status/1362119833324826626

Signed-off-by: Carlos de Paula <me@carlosedp.com>
2021-02-17 19:40:30 -03:00

46 lines
717 B
Verilog

module toplevel #(
parameter RESET_LOW = 1
) (
input clock,
input reset,
output io_tx,
input io_rx,
output io_terminate,
output io_ledB,
output io_ledC
);
wire clock_out;
reg reset_out;
wire lock;
Chiselwatt_pll chiselwatt_pll(
.clki(clock),
.clko(clock_out),
.lock(lock)
);
Core core(
.clock(clock_out),
.reset(reset_out),
.io_tx(io_tx),
.io_rx(io_rx),
.io_terminate(io_terminate),
.io_ledB(io_ledB),
.io_ledC(io_ledC)
);
reg [21:0] cnt = ~0;
always@(posedge clock) begin
if (~lock || (reset ^ RESET_LOW)) begin
cnt <= ~0;
end else if (cnt != 0) begin
cnt <= cnt - 1;
end
reset_out <= |cnt;
end
endmodule