From 1ad824a33038856ae9a61379b4f78f1f6e888fe8 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Fri, 4 Oct 2013 21:46:17 -0400 Subject: add concept of 'board' for seperate ucfs and top level modules --- hdl/main_sp605.v | 31 +++++++++++++++++++++++++++++++ hdl/project.v | 31 ------------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 hdl/main_sp605.v delete mode 100644 hdl/project.v (limited to 'hdl') diff --git a/hdl/main_sp605.v b/hdl/main_sp605.v new file mode 100644 index 0000000..1b4f9f2 --- /dev/null +++ b/hdl/main_sp605.v @@ -0,0 +1,31 @@ +// very minimal example top-level module + +module main ( + output reg [3:0] gpio_led, + input wire [3:0] gpio_switch, + input wire SYSTEMCLOCK, + input wire PUSH_BUTTON_RESET_RAW // this is active low + ); + + wire reset; + assign reset = !PUSH_BUTTON_RESET_RAW; + + reg [25:0] throb_counter = 0; + + always @(posedge SYSTEMCLOCK) begin + if (reset) begin + gpio_led <= 7'b1111; + throb_counter <= 26'd0; + end else begin + gpio_led[1:0] <= gpio_switch[1:0]; + gpio_led[2] <= gpio_switch[2] || gpio_switch[3]; + if (throb_counter >= 26'd50_000_000) begin + gpio_led[3] <= !gpio_led[3]; + throb_counter <= 26'd0; + end else begin + throb_counter <= throb_counter + 26'd1; + end + end + end + +endmodule diff --git a/hdl/project.v b/hdl/project.v deleted file mode 100644 index 1b4f9f2..0000000 --- a/hdl/project.v +++ /dev/null @@ -1,31 +0,0 @@ -// very minimal example top-level module - -module main ( - output reg [3:0] gpio_led, - input wire [3:0] gpio_switch, - input wire SYSTEMCLOCK, - input wire PUSH_BUTTON_RESET_RAW // this is active low - ); - - wire reset; - assign reset = !PUSH_BUTTON_RESET_RAW; - - reg [25:0] throb_counter = 0; - - always @(posedge SYSTEMCLOCK) begin - if (reset) begin - gpio_led <= 7'b1111; - throb_counter <= 26'd0; - end else begin - gpio_led[1:0] <= gpio_switch[1:0]; - gpio_led[2] <= gpio_switch[2] || gpio_switch[3]; - if (throb_counter >= 26'd50_000_000) begin - gpio_led[3] <= !gpio_led[3]; - throb_counter <= 26'd0; - end else begin - throb_counter <= throb_counter + 26'd1; - end - end - end - -endmodule -- cgit v1.2.3