mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-07-26 08:25:31 -04:00
Update PicoRV32 clock frequency to 24 MHz
Include a seed value for nextpnr to get a layout that reaches 24 MHz.
This commit is contained in:
parent
c6e8b6930c
commit
1651a1a666
5 changed files with 13 additions and 12 deletions
|
@ -28,7 +28,7 @@ ICESTORM_PATH ?=
|
||||||
|
|
||||||
# FPGA target frequency. Should be in sync with the clock frequency
|
# FPGA target frequency. Should be in sync with the clock frequency
|
||||||
# given by the parameters to the PLL in rtl/clk_reset_gen.v
|
# given by the parameters to the PLL in rtl/clk_reset_gen.v
|
||||||
TARGET_FREQ ?= 21
|
TARGET_FREQ ?= 24
|
||||||
|
|
||||||
# Size in 32-bit words, must be divisible by 256 (pairs of EBRs, because 16
|
# Size in 32-bit words, must be divisible by 256 (pairs of EBRs, because 16
|
||||||
# bits wide; an EBR is 128 32-bits words)
|
# bits wide; an EBR is 128 32-bits words)
|
||||||
|
@ -343,6 +343,7 @@ application_fpga_par.json: synth.json $(P)/data/$(PIN_FILE)
|
||||||
$(NEXTPNR_PATH)nextpnr-ice40 \
|
$(NEXTPNR_PATH)nextpnr-ice40 \
|
||||||
-l application_fpga_par.txt \
|
-l application_fpga_par.txt \
|
||||||
--freq $(TARGET_FREQ) \
|
--freq $(TARGET_FREQ) \
|
||||||
|
--seed 16124898615009538779 \
|
||||||
--ignore-loops \
|
--ignore-loops \
|
||||||
--up5k \
|
--up5k \
|
||||||
--package sg48 \
|
--package sg48 \
|
||||||
|
|
|
@ -76,13 +76,13 @@ module clk_reset_gen #(
|
||||||
//
|
//
|
||||||
// F_pllout == (F_referenceclk * (DIVF + 1)) / (2^DIVQ * (DIVR + 1))
|
// F_pllout == (F_referenceclk * (DIVF + 1)) / (2^DIVQ * (DIVR + 1))
|
||||||
//
|
//
|
||||||
// Given the 12 MHz HFOSC clock set above, we get a final 21 MHz:
|
// Given the 12 MHz HFOSC clock set above, we get a final 24 MHz:
|
||||||
//
|
//
|
||||||
// (12000000 * (55 + 1)) / (2^5 * (0 + 1)) = 21000000
|
// (12000000 * (63 + 1)) / (2^5 * (0 + 1)) = 24000000
|
||||||
SB_PLL40_CORE #(
|
SB_PLL40_CORE #(
|
||||||
.FEEDBACK_PATH("SIMPLE"),
|
.FEEDBACK_PATH("SIMPLE"),
|
||||||
.DIVR(4'd0), // DIVR = 0
|
.DIVR(4'd0), // DIVR = 0
|
||||||
.DIVF(7'd55), // DIVF = 55
|
.DIVF(7'd63), // DIVF = 63
|
||||||
.DIVQ(3'd5), // DIVQ = 5
|
.DIVQ(3'd5), // DIVQ = 5
|
||||||
.FILTER_RANGE(3'b001) // FILTER_RANGE = 1
|
.FILTER_RANGE(3'b001) // FILTER_RANGE = 1
|
||||||
) pll_inst (
|
) pll_inst (
|
||||||
|
|
|
@ -81,9 +81,9 @@ the implementation:
|
||||||
- 16 oscillators in each group
|
- 16 oscillators in each group
|
||||||
- 64 bits collected before setting the ready flag
|
- 64 bits collected before setting the ready flag
|
||||||
|
|
||||||
With the TKey device running at 18 MHz this means that we sample bits
|
With the TKey device running at 24 MHz this means that we sample bits
|
||||||
at 4.3 kbps. Since we sample twice to produce a single bit, the
|
at 5.8 kbps. Since we sample twice to produce a single bit, the
|
||||||
effective raw bitrate is 2.1 kbps.
|
effective raw bitrate is 2.9 kbps.
|
||||||
|
|
||||||
The 64 bits collected means that there is a separation of at least 32
|
The 64 bits collected means that there is a separation of at least 32
|
||||||
collected entropy bits between bits in the words read out.
|
collected entropy bits between bits in the words read out.
|
||||||
|
|
|
@ -83,10 +83,10 @@ module uart (
|
||||||
// The default bit rate is based on target clock frequency
|
// The default bit rate is based on target clock frequency
|
||||||
// divided by the bit rate times in order to hit the
|
// divided by the bit rate times in order to hit the
|
||||||
// center of the bits. I.e.
|
// center of the bits. I.e.
|
||||||
// Clock: 21 MHz, 62500 bps
|
// Clock: 24 MHz, 62500 bps
|
||||||
// Divisor = 21E6 / 62500 = 336
|
// Divisor = 24E6 / 62500 = 384
|
||||||
// This also satisfies 1E6 % bps == 0 for the CH552 MCU used for USB-serial
|
// This also satisfies 1E6 % bps == 0 for the CH552 MCU used for USB-serial
|
||||||
localparam DEFAULT_BIT_RATE = 16'd336;
|
localparam DEFAULT_BIT_RATE = 16'd384;
|
||||||
localparam DEFAULT_DATA_BITS = 4'h8;
|
localparam DEFAULT_DATA_BITS = 4'h8;
|
||||||
localparam DEFAULT_STOP_BITS = 2'h1;
|
localparam DEFAULT_STOP_BITS = 2'h1;
|
||||||
|
|
||||||
|
|
|
@ -311,8 +311,8 @@ int main(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
puts("\r\nTesting timer... 3");
|
puts("\r\nTesting timer... 3");
|
||||||
// Matching clock at 18 MHz, giving us timer in seconds
|
// Matching clock at 24 MHz, giving us timer in seconds
|
||||||
*timer_prescaler = 18 * 1000000;
|
*timer_prescaler = 24 * 1000000;
|
||||||
|
|
||||||
// Test timer expiration after 1s
|
// Test timer expiration after 1s
|
||||||
*timer = 1;
|
*timer = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue