diff --git a/bench/serv_soc_tb.cpp b/bench/servant_tb.cpp similarity index 93% rename from bench/serv_soc_tb.cpp rename to bench/servant_tb.cpp index f8cb929..844c870 100644 --- a/bench/serv_soc_tb.cpp +++ b/bench/servant_tb.cpp @@ -2,7 +2,7 @@ #include #include "verilated_vcd_c.h" -#include "Vserv_wrapper.h" +#include "Vservant.h" using namespace std; @@ -34,7 +34,7 @@ int main(int argc, char **argv, char **env) char uart_ch = 0; Verilated::commandArgs(argc, argv); - Vserv_wrapper* top = new Vserv_wrapper; + Vservant* top = new Vservant; const char *arg = Verilated::commandArgsPlusMatch("uart_baudrate="); if (arg[0]) { @@ -55,9 +55,10 @@ int main(int argc, char **argv, char **env) signal(SIGINT, INThandler); - top->i_clk = 1; + top->wb_clk = 1; bool q = top->q; while (!(done || Verilated::gotFinish())) { + top->wb_rst = main_time < 100; top->eval(); if (tfp) tfp->dump(main_time); @@ -96,8 +97,9 @@ int main(int argc, char **argv, char **env) printf("%lu output q is %s\n", main_time, q ? "ON" : "OFF"); } }*/ - top->i_clk = !top->i_clk; + top->wb_clk = !top->wb_clk; main_time+=31.25; + } if (tfp) tfp->close(); diff --git a/bench/serv_top_tb.v b/bench/servant_tb.v similarity index 52% rename from bench/serv_top_tb.v rename to bench/servant_tb.v index 724284c..53e07cf 100644 --- a/bench/serv_top_tb.v +++ b/bench/servant_tb.v @@ -1,18 +1,20 @@ `default_nettype none -module serv_top_tb; +module servant_tb; - parameter memfile = "bitbang.hex"; + parameter memfile = ""; - reg wb_clk = 1'b1; + reg wb_clk = 1'b0; + reg wb_rst = 1'b1; reg q_r = 1'b0; wire q; - always #31 wb_clk <= !wb_clk; + always #31 wb_clk <= !wb_clk; + initial #62 wb_rst <= 1'b0; vlog_tb_utils vtu(); - serv_wrapper #(memfile) dut(wb_clk, q); + servant #(memfile) dut(wb_clk, wb_rst, q); always @(posedge wb_clk) if (q != q_r) begin diff --git a/bitbang.hex b/bitbang.hex deleted file mode 100644 index 4b3e02d..0000000 ---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 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 diff --git a/serv.core b/serv.core index 5de8795..ae4b1d8 100644 --- a/serv.core +++ b/serv.core @@ -21,79 +21,10 @@ filesets: - rtl/serv_top.v file_type : verilogSource - ice40_pll: - files: - - rtl/ice40_pll.v : {file_type : verilogSource} - depend : ["fusesoc:utils:generators"] - - mem_files: - files: - - sw/blinky.hex : {copyto : blinky.hex} - - sw/zephyr_hello.hex : {copyto : zephyr_hello.hex} - file_type : user - - serv_top_tb: - files: - - bench/serv_top_tb.v - file_type : verilogSource - depend : [vlog_tb_utils] - - wrapper: - files: - - rtl/serv_clock_gen.v - - rtl/riscv_timer.v - - rtl/wb_gpio.v - - bench/serv_arbiter.v - - bench/serv_mux.v - - bench/serv_wrapper.v - file_type : verilogSource - depend : [wb_ram] - - netlist: - files: [synth.v : {file_type : verilogSource}] - - tinyfpga_bx: - files: - - data/tinyfpga_bx.pcf : {file_type : PCF} - - icebreaker: - files: - - data/icebreaker.pcf : {file_type : PCF} - - verilator_tb: - files: - - bench/serv_soc_tb.cpp : {file_type : cppSource} - targets: default: filesets : [core] - - icebreaker: - default_tool : icestorm - filesets : [core, ice40_pll, mem_files, wrapper, icebreaker] - generate: [icebreaker_pll] - parameters : [memfile, memsize, PLL=ICE40_PAD] - tools: - icestorm: - nextpnr_options: [--up5k, --freq, 16] - pnr: next - toplevel : serv_wrapper - - synth: - default_tool : icestorm - filesets : [core, mem_files, wrapper, tinyfpga_bx] - toplevel : serv_wrapper - - tinyfpga_bx: - default_tool : icestorm - filesets : [core, ice40_pll, mem_files, wrapper, tinyfpga_bx] - generate: [tinyfpga_bx_pll] - parameters : [memfile, memsize, PLL=ICE40_CORE] - tools: - icestorm: - nextpnr_options : [--lp8k, --package, cm81, --freq, 32] - pnr: next - toplevel : serv_wrapper + parameters : [RISCV_FORMAL] lint: default_tool : verilator @@ -103,72 +34,8 @@ targets: mode : lint-only toplevel : serv_top - serv_top_tb: - default_tool: icarus - filesets : [core, wrapper, serv_top_tb] - parameters : [RISCV_FORMAL=true, firmware] - toplevel : serv_top_tb - - synth_tb: - default_tool: icarus - filesets : [netlist, serv_top_tb] - toplevel : serv_top_tb - - verilator_tb: - default_tool: verilator - filesets : [core, wrapper, verilator_tb] - parameters : [RISCV_FORMAL, firmware, memsize, signature, uart_baudrate, vcd] - tools: - verilator: - verilator_options : [--trace] - toplevel : serv_wrapper - parameters: - PLL: - datatype : str - description : PLL type to use for main clock generation - paramtype : vlogparam - RISCV_FORMAL: datatype : bool paramtype : vlogdefine - firmware: - datatype : file - description : Preload RAM with a hex file at runtime (overrides memfile) - paramtype : plusarg - - memfile: - datatype : file - description : Preload RAM with a hex file at compile-time - paramtype : vlogparam - - memsize: - datatype : int - default : 8192 - description : Memory size in bytes for RAM (default 8kiB) - paramtype : vlogparam - - signature: - datatype : file - paramtype : plusarg - uart_baudrate: - datatype : int - description : Treat q output as an UART with the specified baudrate (0 or omitted parameter disables UART decoding) - paramtype : plusarg - - vcd: - datatype : bool - paramtype : plusarg - -generate: - icebreaker_pll: - generator: icepll - parameters: - freq_out : 16 - - tinyfpga_bx_pll: - generator: icepll - parameters: - freq_in : 16 - freq_out : 32 diff --git a/servant.core b/servant.core new file mode 100644 index 0000000..41fc91c --- /dev/null +++ b/servant.core @@ -0,0 +1,138 @@ +CAPI=2: + +name : ::servant:0 + +filesets: + service: + files: + - servant/ice40_pll.v + - servant/service.v + file_type : verilogSource + depend : ["fusesoc:utils:generators"] + + mem_files: + files: + - sw/blinky.hex : {copyto : blinky.hex} + - sw/zephyr_hello.hex : {copyto : zephyr_hello.hex} + file_type : user + + servant_tb: + files: + - bench/servant_tb.v + file_type : verilogSource + depend : [vlog_tb_utils] + + soc: + files: + - servant/servant_clock_gen.v + - servant/servant_timer.v + - servant/servant_gpio.v + - servant/servant_arbiter.v + - servant/servant_mux.v + - servant/servant.v + file_type : verilogSource + depend : [serv, wb_ram] + + tinyfpga_bx: {files: [data/tinyfpga_bx.pcf : {file_type : PCF}]} + icebreaker : {files: [data/icebreaker.pcf : {file_type : PCF}]} + + verilator_tb: {files: [bench/servant_tb.cpp : {file_type : cppSource}]} + +targets: + default: + filesets : [soc] + + icebreaker: + default_tool : icestorm + filesets : [mem_files, soc, service, icebreaker] + generate: [icebreaker_pll] + parameters : [memfile, memsize, PLL=ICE40_PAD] + tools: + icestorm: + nextpnr_options: [--up5k, --freq, 16] + pnr: next + toplevel : service + + tinyfpga_bx: + default_tool : icestorm + filesets : [mem_files, soc, service, tinyfpga_bx] + generate: [tinyfpga_bx_pll] + parameters : [memfile, memsize, PLL=ICE40_CORE] + tools: + icestorm: + nextpnr_options : [--lp8k, --package, cm81, --freq, 32] + pnr: next + toplevel : service + + lint: + default_tool : verilator + filesets : [soc] + tools: + verilator: + mode : lint-only + toplevel : servant + + sim: + default_tool: icarus + filesets : [soc, servant_tb] + parameters : [RISCV_FORMAL=true, firmware] + toplevel : servant_tb + + verilator_tb: + default_tool: verilator + filesets : [soc, verilator_tb] + parameters : [RISCV_FORMAL, firmware, memsize, signature, uart_baudrate, vcd] + tools: + verilator: + verilator_options : [--trace] + toplevel : servant + +parameters: + PLL: + datatype : str + description : PLL type to use for main clock generation + paramtype : vlogparam + + RISCV_FORMAL: + datatype : bool + paramtype : vlogdefine + + firmware: + datatype : file + description : Preload RAM with a hex file at runtime (overrides memfile) + paramtype : plusarg + + memfile: + datatype : file + description : Preload RAM with a hex file at compile-time + paramtype : vlogparam + + memsize: + datatype : int + default : 8192 + description : Memory size in bytes for RAM (default 8kiB) + paramtype : vlogparam + + signature: + datatype : file + paramtype : plusarg + uart_baudrate: + datatype : int + description : Treat q output as an UART with the specified baudrate (0 or omitted parameter disables UART decoding) + paramtype : plusarg + + vcd: + datatype : bool + paramtype : plusarg + +generate: + icebreaker_pll: + generator: icepll + parameters: + freq_out : 16 + + tinyfpga_bx_pll: + generator: icepll + parameters: + freq_in : 16 + freq_out : 32 diff --git a/rtl/ice40_pll.v b/servant/ice40_pll.v similarity index 100% rename from rtl/ice40_pll.v rename to servant/ice40_pll.v diff --git a/bench/serv_wrapper.v b/servant/servant.v similarity index 95% rename from bench/serv_wrapper.v rename to servant/servant.v index 28418fd..4d1bbd2 100644 --- a/bench/serv_wrapper.v +++ b/servant/servant.v @@ -1,21 +1,12 @@ `default_nettype none -module serv_wrapper +module servant ( - input wire i_clk, + input wire wb_clk, + input wire wb_rst, output wire q); parameter memfile = "zephyr_hello.hex"; parameter memsize = 8192; - parameter PLL = "NONE"; - - wire wb_clk; - wire wb_rst; - - serv_clock_gen #(.PLL (PLL)) - clock_gen - (.i_clk (i_clk), - .o_clk (wb_clk), - .o_rst (wb_rst)); wire timer_irq; diff --git a/bench/serv_arbiter.v b/servant/servant_arbiter.v similarity index 100% rename from bench/serv_arbiter.v rename to servant/servant_arbiter.v diff --git a/rtl/serv_clock_gen.v b/servant/servant_clock_gen.v similarity index 95% rename from rtl/serv_clock_gen.v rename to servant/servant_clock_gen.v index ac771ba..c430de8 100644 --- a/rtl/serv_clock_gen.v +++ b/servant/servant_clock_gen.v @@ -1,5 +1,5 @@ `default_nettype none -module serv_clock_gen +module servant_clock_gen ( input wire i_clk, output wire o_clk, diff --git a/rtl/wb_gpio.v b/servant/servant_gpio.v similarity index 100% rename from rtl/wb_gpio.v rename to servant/servant_gpio.v diff --git a/bench/serv_mux.v b/servant/servant_mux.v similarity index 100% rename from bench/serv_mux.v rename to servant/servant_mux.v diff --git a/rtl/riscv_timer.v b/servant/servant_timer.v similarity index 100% rename from rtl/riscv_timer.v rename to servant/servant_timer.v diff --git a/servant/service.v b/servant/service.v new file mode 100644 index 0000000..f8328d4 --- /dev/null +++ b/servant/service.v @@ -0,0 +1,28 @@ +`default_nettype none +module service +( + input wire i_clk, + output wire q); + + parameter memfile = "zephyr_hello.hex"; + parameter memsize = 8192; + parameter PLL = "NONE"; + + wire wb_clk; + wire wb_rst; + + servant_clock_gen #(.PLL (PLL)) + clock_gen + (.i_clk (i_clk), + .o_clk (wb_clk), + .o_rst (wb_rst)); + + servant + #(.memfile (memfile), + .memsize (memsize)) + servant + (.wb_clk (wb_clk), + .wb_clk (wb_clk), + .q (q)); + +endmodule