+`include "pll.v"
`include "gc.v"
`include "eval.v"
`include "reader.v"
`define UART_DIVIDE 625
`endif
-module cpu (input clk, output [4:0] led, output uart_tx, input uart_rx);
+module cpu (input CLKin, output [4:0] led, output uart_tx, input uart_rx);
+ wire clk;
+
+ pll pll (.clock_in(CLKin), .clock_out(clk));
+
wire [12:0] freeptr;
wire [15:0] E1;
wire [15:0] E2;
wire uart_tx_signal;
wire [7:0] uart_tx_byte;
- // 4800 baud uart
+ // 19200 baud uart
uart #(.CLOCK_DIVIDE(`UART_DIVIDE)) uart (.clk(clk), .rx(uart_rx), .tx(uart_tx), .transmit(uart_tx_signal), .tx_byte(uart_tx_byte), .received(uart_rx_signal), .rx_byte(uart_rx_byte), .is_receiving(uart_is_receiving), .is_transmitting(uart_is_transmitting), .recv_error (uart_rx_error));
endmodule
--- /dev/null
+/**
+ * PLL configuration
+ *
+ * This Verilog module was generated automatically
+ * using the icepll tool from the IceStorm project.
+ * Use at your own risk.
+ *
+ * Given input frequency: 12.000 MHz
+ * Requested output frequency: 48.000 MHz
+ * Achieved output frequency: 48.000 MHz
+ */
+
+module pll(
+ input clock_in,
+ output clock_out,
+ output locked
+ );
+
+SB_PLL40_CORE #(
+ .FEEDBACK_PATH("SIMPLE"),
+ .DIVR(4'b0000), // DIVR = 0
+ .DIVF(7'b0111111), // DIVF = 63
+ .DIVQ(3'b100), // DIVQ = 4
+ .FILTER_RANGE(3'b001) // FILTER_RANGE = 1
+ ) uut (
+ .LOCK(locked),
+ .RESETB(1'b1),
+ .BYPASS(1'b0),
+ .REFERENCECLK(clock_in),
+ .PLLOUTCORE(clock_out)
+ );
+
+endmodule