-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Trenz Electronic TE0802
- Loading branch information
Showing
5 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Clock signal | ||
set_property -dict { PACKAGE_PIN J3 IOSTANDARD LVCMOS18 } [get_ports i_clk]; | ||
create_clock -add -name sys_clk_pin -period 40.00 [get_ports i_clk]; | ||
|
||
## LED 0 | ||
set_property -dict { PACKAGE_PIN P1 IOSTANDARD LVCMOS18 } [get_ports o_led_0]; | ||
|
||
# PMOD A, Connector J5 | ||
# Connector pin, Package pin, PMOD type 4 UART | ||
# 1, F8, CTS | ||
# 2, F7, TXD | ||
# 3, E6, RXD | ||
# 4, E5, RTS | ||
# 5, GND | ||
# 6, VCC | ||
# 7, G6, | ||
# 8, G5, | ||
# 9, C8, | ||
# 10, C7, | ||
# 11, GND | ||
# 12, VCC | ||
set_property -dict { PACKAGE_PIN F7 IOSTANDARD LVCMOS33 } [get_ports o_uart_tx] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
`default_nettype none | ||
module servant_te0802 | ||
( | ||
input wire i_clk, | ||
output wire o_uart_tx, | ||
output wire o_led_0 | ||
); | ||
|
||
parameter memfile = "zephyr_hello.hex"; | ||
parameter memsize = 8192; | ||
|
||
wire clk; | ||
wire rst; | ||
wire q; | ||
|
||
assign o_uart_tx = q; | ||
assign o_led_0 = q; | ||
|
||
servant_te0802_clock_gen | ||
clock_gen | ||
(.i_clk (i_clk), | ||
.o_clk (clk), | ||
.o_rst (rst)); | ||
|
||
servant | ||
#(.memfile (memfile), | ||
.memsize (memsize)) | ||
servant | ||
(.wb_clk (clk), | ||
.wb_rst (rst), | ||
.q (q)); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
`default_nettype none | ||
module servant_te0802_clock_gen | ||
(input wire i_clk, | ||
output wire o_clk, | ||
output reg o_rst); | ||
|
||
wire clkfb; | ||
wire locked; | ||
reg locked_r; | ||
|
||
// Generate a 32 MHz clock from the 25MHz clock input | ||
MMCME4_ADV | ||
#(.DIVCLK_DIVIDE (1), | ||
.CLKFBOUT_MULT_F (48.000), | ||
.CLKOUT0_DIVIDE_F (37.5), | ||
.CLKIN1_PERIOD (40.0), //25MHz | ||
.STARTUP_WAIT ("FALSE")) | ||
mmcm | ||
(.CLKFBOUT (clkfb), | ||
.CLKFBOUTB (), | ||
.CLKOUT0 (o_clk), | ||
.CLKOUT0B (), | ||
.CLKOUT1 (), | ||
.CLKOUT1B (), | ||
.CLKOUT2 (), | ||
.CLKOUT2B (), | ||
.CLKOUT3 (), | ||
.CLKOUT3B (), | ||
.CLKOUT4 (), | ||
.CLKOUT5 (), | ||
.CLKOUT6 (), | ||
.CLKIN1 (i_clk), | ||
.CLKIN2 (1'b0), | ||
.CLKINSEL (1'b1), | ||
.LOCKED (locked), | ||
.PWRDWN (1'b0), | ||
.RST (1'b0), | ||
.CLKFBIN (clkfb)); | ||
|
||
always @(posedge o_clk) begin | ||
locked_r <= locked; | ||
o_rst <= !locked_r; | ||
end | ||
|
||
endmodule |