diff --git a/data/lx9_microboard.ucf b/data/lx9_microboard.ucf new file mode 100644 index 0000000..3d73549 --- /dev/null +++ b/data/lx9_microboard.ucf @@ -0,0 +1,9 @@ +CONFIG VCCAUX=3.3; + +NET i_clk LOC = V10 | IOSTANDARD = LVCMOS33; +NET i_rst LOC = V4 | IOSTANDARD = LVCMOS33 | PULLDOWN; +NET q LOC = P4 | IOSTANDARD = LVCMOS18; +NET o_uart_tx LOC = T7 | IOSTANDARD = LVCMOS33; + +NET i_clk TNM_NET = clk; +TIMESPEC TS_USER_CLOCK = PERIOD clk 40000 kHz; diff --git a/servant.core b/servant.core index a08d317..c9c4f95 100644 --- a/servant.core +++ b/servant.core @@ -47,6 +47,12 @@ filesets: icebreaker : {files: [data/icebreaker.pcf : {file_type : PCF}]} alhambra : {files: [data/alhambra.pcf : {file_type : PCF}]} + lx9_microboard: + files: + - servant/servant_lx9_clock_gen.v : {file_type : verilogSource} + - servant/servant_lx9.v : {file_type : verilogSource} + - data/lx9_microboard.ucf : {file_type : UCF} + nexys_a7: files: - servant/servix_clock_gen.v : {file_type : verilogSource} @@ -108,6 +114,20 @@ targets: pnr: next toplevel : service + lx9_microboard: + default_tool: ise + description : LX9 Microboard + filesets : [mem_files, soc, lx9_microboard] + parameters : [memfile, memsize] + tools: + ise: + family : Spartan6 + device : xc6slx9 + package : csg324 + speed : -2 + toplevel : servant_lx9 + + tinyfpga_bx: default_tool : icestorm filesets : [mem_files, soc, service, tinyfpga_bx] diff --git a/servant/servant_lx9.v b/servant/servant_lx9.v new file mode 100644 index 0000000..41c2c2a --- /dev/null +++ b/servant/servant_lx9.v @@ -0,0 +1,32 @@ +`default_nettype none +module servant_lx9 +( + input wire i_clk, + input wire i_rst, + output wire o_uart_tx, + output wire q); + + parameter memfile = "zephyr_hello.hex"; + parameter memsize = 8192; + + wire wb_clk; + wire wb_rst; + + assign o_uart_tx = q; + + servant_lx9_clock_gen + clock_gen + (.i_clk (i_clk), + .i_rst (i_rst), + .o_clk (wb_clk), + .o_rst (wb_rst)); + + servant + #(.memfile (memfile), + .memsize (memsize)) + servant + (.wb_clk (wb_clk), + .wb_rst (wb_rst), + .q (q)); + +endmodule diff --git a/servant/servant_lx9_clock_gen.v b/servant/servant_lx9_clock_gen.v new file mode 100644 index 0000000..bd9d4ba --- /dev/null +++ b/servant/servant_lx9_clock_gen.v @@ -0,0 +1,35 @@ +`default_nettype none +module servant_lx9_clock_gen + (input wire i_clk, + input wire i_rst, + output wire o_clk, + output reg o_rst); + + wire clkfb; + wire locked; + reg locked_r; + + PLL_BASE + #(.BANDWIDTH("OPTIMIZED"), + .CLKFBOUT_MULT(16), + .CLKIN_PERIOD(25.0), //40MHz + .CLKOUT1_DIVIDE(40), //16MHz + .DIVCLK_DIVIDE(1)) + PLL_BASE_inst + (.CLKOUT1(o_clk), + .CLKOUT2(), + .CLKOUT3(), + .CLKOUT4(), + .CLKOUT5(), + .CLKFBOUT(clkfb), + .LOCKED(locked), + .CLKIN(i_clk), + .RST(i_rst), + .CLKFBIN(clkfb)); + + always @(posedge o_clk) begin + locked_r <= locked; + o_rst <= !locked_r; + end + +endmodule