This repository implements a UART‑controlled processing system that performs register file operations and ALU computations across two clock domains. An asynchronous FIFO bridges the clock-domain crossing between a 50 MHz reference clock and a 3.6864 MHz UART clock, ensuring reliable data transfer.
Key capabilities:
- Configuration and data transfer via UART frames
- Register file reads/writes
- Full ALU support (arithmetic, logic, comparison, shifts)
- Clock gating and synchronization modules
-
REF_CLK (50 MHz): Drives
RegFile,ALU,SYS_CTRL, andClock Gatingblocks. -
UART_CLK (3.6864 MHz): Drives
UART_RX,UART_TX,Pulse_Gen, andClock Divider. -
Synchronization:
RST_Synchronizerfor reset alignmentData_Synchronizerfor single‑cycle pulsesASYNC_FIFOfor multi‑word data crossing fileciteturn2file0
- SYS_CTRL: Orchestrates all operations—parses UART commands, drives
RegFile&ALU, and writes results back via UART. - RegFile: 16×8‑bit register file with read/write interface and
RdData_Validflag. - ALU: 8‑bit operands, 4‑bit function select, supports add, sub, mult, div, logic, compare, shift, etc.
- Clock Gating: Enables/disables ALU clock based on
SYS_CTRLsignal. - Clock Divider: Generates UART_CLK from REF_CLK based on register‐programmable ratio.
- UART_TX/RX: Frame‐based serial interface with parity/strobe, connected through FIFO.
- Pulse_Gen: Converts level signals to pulses for FIFO reads.
- Synchronizers:
RST_Sync,Data_Syncfor robust multi‑domain operation. - ASYNC_FIFO: 8‑bit wide, depth configurable, with
full/emptyflags, bridging REF_CLK→UART_CLK domains.
Supported commands are sent as multi‑byte frames from the master testbench:
| Command | Opcode | Frames | Payload |
|---|---|---|---|
| RF Write | 0xAA | 3 | [Addr][Data] |
| RF Read | 0xBB | 2 | [Addr] |
| ALU Op w/ Operands | 0xCC | 4 | [A][B][Func] |
| ALU Op w/o Operands | 0xDD | 2 | [Func] |
The system decodes each frame, performs the specified operation, then sends back result frames over UART.
-
Register File: Read/Write to arbitrary addresses (0x4–0x15).
-
ALU:
- Arithmetic:
+,-,×,÷ - Logical:
AND,OR,NAND,NOR,XOR,XNOR - Compare:
A==B,A>B - Shift:
>>1,<<1
- Arithmetic:
Configuration registers (0x0–0x3) define parity, prescale, and division ratios for UART and clock divider. fileciteturn2file0
-
UVM‑Based TB under
tb/generates UART frames, drives resets, and checks responses. -
Sequence of Operation:
- Initialize configuration registers via RF_Write (addresses 0x2, 0x3)
- Send mixed stream of RF_Read/Write and ALU commands
- Verify FIFO full/empty flags and data flow across domains
- Capture and validate UART_TX result frames against expected values
- Prerequisites: SystemVerilog simulator (VCS/Questa/Xcelium), UVM installation.