Skip to content

Commit 042e62e

Browse files
committed
move makefile
1 parent 963b5c7 commit 042e62e

File tree

5 files changed

+41
-87
lines changed

5 files changed

+41
-87
lines changed

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
TOP_NAME := transceiver
2+
IVERILOG := iverilog
3+
GTKWAVE := gtkwave
4+
GTKW_FILE := top/tb/gtkw.gtkw
5+
6+
SRC_FILES += top/transceiver_top.v
7+
SRC_FILES += top/tb/transceiver_tb.v
8+
SRC_FILES += modules/hamming/hamming_decoder.v
9+
SRC_FILES += modules/hamming/hamming_encoder.v
10+
SRC_FILES += modules/bpsk/bpsk_modulator.v
11+
SRC_FILES += modules/bpsk/bpsk_demodulator.v
12+
SRC_FILES += modules/bpsk/sin_generator.v
13+
SRC_FILES += modules/uart/UART/Verilog/source/UART_RX.v
14+
SRC_FILES += modules/uart/UART/Verilog/source/UART_TX.v
15+
16+
.PHONY: all clean
17+
18+
all: build execute simulate
19+
20+
build:
21+
$(IVERILOG) -o $(TOP_NAME) $(SRC_FILES)
22+
23+
execute:
24+
vvp $(TOP_NAME)
25+
26+
simulate:
27+
$(GTKWAVE) $(TOP_NAME)_tb.vcd
28+
29+
clean:
30+
rm $(TOP_NAME)
31+
rm $(TOP_NAME)_tb.vcd

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,5 @@ deactivate
7777

7878
### Icarus simulation:
7979
```bash
80-
cd top
8180
make
8281
```

top/Makefile

Lines changed: 0 additions & 30 deletions
This file was deleted.

top/gtkw.gtkw

Lines changed: 0 additions & 46 deletions
This file was deleted.

top/transceiver_top.v

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ module transceiver_top #(
88
parameter SAMPLE_NUMBER = 256, //! numbers of sample in one sine period
99
parameter SAMPLE_WIDTH = 12, //! sample width
1010
parameter DATA_WIDTH = 12, //! data width
11-
parameter SIN_VALUE = "sin_val.dat", //! dat file with sine samples
12-
parameter NEG_SIN_VALUE = "neg_sin_val.dat" //! dat file with negative sine samples
11+
parameter SIN_VALUE = "top/sin_val.dat", //! dat file with sine samples
12+
parameter NEG_SIN_VALUE = "top/neg_sin_val.dat" //! dat file with negative sine samples
1313
) (
1414
input wire clk, //! clock input (100 MHz)
1515
input wire arstn, //! asynchronous reset input (negative)
1616
input wire data, //! data input
1717
input wire en, //! enable input
1818
output wire q //! quit output
19-
);
20-
19+
);
20+
2121
// wire clk10_out; //! 10 MHz clock from PLL
2222
wire done; //! uart transmit done output
23-
wire active; //! uart transmit active output
23+
wire active; //! uart transmit active output
2424
wire data_valid; //! uart transmit data valid output
2525
wire [7:0 ] uart_rx_out; //! uart receive instance output
26-
wire [7:0 ] decoder_out; //! hamming decoder instance output
27-
wire [DATA_WIDTH-1:0 ] encoder_out; //! hamming encoder instance output
26+
wire [7:0 ] decoder_out; //! hamming decoder instance output
27+
wire [DATA_WIDTH-1:0 ] encoder_out; //! hamming encoder instance output
2828
wire [$clog2(SAMPLE_NUMBER)-1:0] cnt_out; //! sine generator counter output
2929
wire [DATA_WIDTH-1:0 ] demodulator_out; //! binary phase shift key demodulator instance output
30-
wire [SAMPLE_WIDTH-1:0 ] modulator_out; //! binary phase shift key modulator instance output
30+
wire [SAMPLE_WIDTH-1:0 ] modulator_out; //! binary phase shift key modulator instance output
3131
wire [SAMPLE_WIDTH-1:0 ] neg_sin_out; //! negative sine generator output
3232
wire [SAMPLE_WIDTH-1:0 ] sin_out; //! sine generator output
3333

@@ -96,14 +96,14 @@ module transceiver_top #(
9696
);
9797

9898
hamming_decoder decoder_inst ( //! hamming decoder instance
99-
// .clk (clk10_out),
99+
// .clk (clk10_out),
100100
.clk (clk ),
101101
.arstn (arstn ),
102102
.rden (en ),
103103
.hc_in (demodulator_out),
104104
.q (decoder_out )
105105
);
106-
106+
107107
UART_TX #( //! uart transmit instance
108108
.CLKS_PER_BIT (CLKS_PER_BIT)
109109
) uart_tx_inst (

0 commit comments

Comments
 (0)