diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-12 21:27:41 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-12 21:27:41 +0200 |
commit | deb7d0a6fc76d5250c238d479cf97d4755abef01 (patch) | |
tree | 395c266ff4757e83e151d1286d6d2388e63d9a9c /src/top.v | |
parent | 008059fbe4e960a10bb4c444013129e0aaa02818 (diff) | |
download | riscv_cpu-deb7d0a6fc76d5250c238d479cf97d4755abef01.tar.gz riscv_cpu-deb7d0a6fc76d5250c238d479cf97d4755abef01.zip |
refactoring
Diffstat (limited to 'src/top.v')
-rw-r--r-- | src/top.v | 34 |
1 files changed, 9 insertions, 25 deletions
@@ -1,36 +1,20 @@ module top ( input clk, input key - //output [5:0] led ); -wire rst; -assign rst = ~key; +wire rstn, clk_cpu; +assign rstn = key; -cpu cpu ( - .clk(clk), - .rst(rst) +clock_divider #(.N(1024 * 1024)) clkdiv ( + .clk(clk), + .reset(!rstn), + .clk_out(clk_cpu) ); -/* - -reg [5:0] ctr_q; -wire [5:0] ctr_d; -wire clk_slow; -assign reset = ~key; - -clock_divider #(.N(10000000)) clk_div ( - .clk(clk), - .clk_out(clk_slow), - .reset(reset) +cpu cpu ( + .clk(clk_cpu), + .rstn(rstn) ); -always @(posedge clk_slow) begin - if (key) ctr_q <= ctr_d; - else ctr_q <= 6'b0; -end - -assign ctr_d = ctr_q + 6'b1; -assign led = ~ctr_q; -*/ endmodule |