From 25d180659072dcdcd9821a0ea91fa7706b01a9fb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 6 Sep 2024 21:08:51 -0700 Subject: [PATCH] lib/ClockOut: hack module to export a clock as an ordinary signal Used to output a clock signal from an FPGA pin. The resultant output signal is unclocked, so can be presented to any output at will. --- lib/ClockOut.bsv | 16 ++++++++++++++++ lib/ClockOut.v | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 lib/ClockOut.bsv create mode 100644 lib/ClockOut.v diff --git a/lib/ClockOut.bsv b/lib/ClockOut.bsv new file mode 100644 index 0000000..5517e39 --- /dev/null +++ b/lib/ClockOut.bsv @@ -0,0 +1,16 @@ +package ClockOut; + +interface ClockOut; + method bit value(); +endinterface + +import "BVI" ClockOut = + module mkClockOut(ClockOut); + default_reset no_reset; + default_clock clk (CLK, (* unused *)GATE); + + method CLK_BIT value() clocked_by(no_clock); + + schedule value CF value; + endmodule +endpackage diff --git a/lib/ClockOut.v b/lib/ClockOut.v new file mode 100644 index 0000000..77b7939 --- /dev/null +++ b/lib/ClockOut.v @@ -0,0 +1,3 @@ +module ClockOut(input CLK, output CLK_BIT); + assign CLK_BIT = CLK; +endmodule