[ENGLISH VERSION BELOW]
Questo repository contiene l'implementazione hardware in VHDL del Progetto Finale di Reti Logiche per l'Anno Accademico 2022-2023 del Politecnico di Milano.
Autori: Matteo Figini & Fabrizio Monti
Il sistema progettato agisce ad alto livello come un "puntatore a memoria". Il modulo riceve un flusso di bit seriale da cui estrae l'indirizzo di una specifica locazione di memoria e il canale di uscita desiderato. Successivamente, accede alla memoria, preleva il dato a 8 bit e lo rende disponibile in parallelo su uno dei quattro canali di uscita disponibili (Z0, Z1, Z2, Z3).
- Il canale di uscita è identificato dai primi 2 bit di intestazione del flusso seriale.
- L'indirizzo di memoria è specificato dai successivi N bit (fino a un massimo di 16 bit).
- L'intero processo, dal momento in cui il segnale di inizio va basso fino alla generazione del risultato valido, impiega un massimo di 20 cicli di clock.
Il progetto è stato sviluppato seguendo un approccio intermedio che divide l'architettura in due macro-componenti:
- Datapath (Descrizione Strutturale): Integra vari elementi combinatori (Multiplexer, Decoder, Demultiplexer) e sequenziali (Shift Register SIPO per immagazzinare canale e indirizzo, registri dati).
- Macchina a Stati Finiti - FSM (Descrizione Comportamentale): Basata su una macchina di Mealy a 8 stati. Gli stati governano il ciclo vitale dell'elaborazione:
- Reset e attesa
RESET. - Lettura dei bit di canale
CHANNEL0,CHANNEL1e dell'indirizzoADDRESS_READ. - Attesa del dato dalla RAM
WAIT_RAMe successiva scritturaWRITE_DATA. - Reset dei registri interni
DATA_ASSESTe visualizzazione del dato in uscitaDONE_READ.
- Reset e attesa
L'entità principale project_reti_logiche comunica con l'esterno e con la memoria tramite le seguenti interfacce:
- Segnali di controllo:
i_clk,i_rst: Clock unico e reset asincrono del sistema.i_start: Segnale che abilita la validità della sequenza in ingresso.i_w: Ingresso seriale a 1 bit.
- Canali di Uscita:
o_z0,o_z1,o_z2,o_z3: Quattro canali di uscita parallela a 8 bit.o_done: Segnale impulsivo (durata 1 ciclo di clock) che convalida il dato presente sul canale di uscita selezionato.
- Interfaccia Memoria:
o_mem_addr: Indirizzo di memoria a 16 bit.i_mem_data: Dato a 8 bit letto dalla memoria.o_mem_en,o_mem_we: Segnali per abilitare la memoria e la scrittura (scrittura sempre disabilitata in questo progetto).
Il componente è stato sintetizzato tramite il tool Xilinx Vivado (versione 2019.2) ottenendo risultati che rispettano i vincoli prestazionali:
- Slack (MET): 97.006 ns. Il circuito è al di sotto del requisito di 100 ns imposto dalle specifiche.
- Flip-Flop utilizzati: 53.
- Latch inferiti: 0. L'assenza di Latch evidenzia che tutti i processi combinatori sono stati definiti correttamente, senza assegnazioni mancanti.
- Simulazioni: Il modulo supera con successo i Test Bench (Behavioral e Post-Synthesis) standard e le simulazioni sui corner-cases personalizzate (es. ripristino post reset asincrono o variazioni estreme nella lunghezza dell'indirizzo).
[ENGLISH VERSION]
This repository contains the hardware implementation in VHDL of the Final Project for the Logic Design course for the Academic Year 2022-2023 at Politecnico di Milano.
Authors: Matteo Figini & Fabrizio Monti
- The designed system acts at a high level as a "memory pointer".
- The module receives a serial bit stream from which it extracts the address of a specific memory location and the desired output channel.
- Subsequently, it accesses the memory, retrieves the 8-bit data, and makes it available in parallel on one of the four available output channels (Z0, Z1, Z2, Z3).
- The output channel is identified by the first 2 header bits of the serial stream.
- The memory address is specified by the subsequent N bits (up to a maximum of 16 bits).
- The entire process, from the moment the start signal goes low until the generation of the valid result, takes a maximum of 20 clock cycles.
The project was developed following an intermediate approach that divides the architecture into two macro-components:
- Datapath (Structural Description): Integrates various combinational elements (Multiplexers, Decoders, Demultiplexers) and sequential elements (SIPO Shift Registers to store channel and address, data registers).
- Finite State Machine - FSM (Behavioral Description): Based on an 8-state Mealy machine. The states govern the processing lifecycle:
- Reset and wait
RESET. - Reading channel bits
CHANNEL0,CHANNEL1and the addressADDRESS_READ. - Waiting for data from RAM
WAIT_RAMand subsequent writingWRITE_DATA. - Reset of internal registers
DATA_ASSESTand output data visualizationDONE_READ.
- Reset and wait
The main entity project_reti_logiche communicates with the outside and with the memory through the following interfaces:
- Control Signals:
i_clk,i_rst: Single clock and asynchronous system reset.i_start: Signal that enables the validity of the input sequence.i_w: 1-bit serial input.
- Output Channels:
o_z0,o_z1,o_z2,o_z3: Four 8-bit parallel output channels.o_done: Impulsive signal (duration of 1 clock cycle) that validates the data present on the selected output channel.
- Memory Interface:
o_mem_addr: 16-bit memory address.i_mem_data: 8-bit data read from memory.o_mem_en,o_mem_we: Signals to enable the memory and writing (writing is always disabled in this project, meaning it remains at 0).
The component was synthesized using the Xilinx Vivado (version 2019.2) tool, obtaining results that respect the performance constraints:
- Slack (MET): 97.006 ns. The circuit is below the 100 ns requirement imposed by the specifications.
- Flip-Flops used: 53.
- Latches inferred: 0. The absence of Latches highlights that all combinational processes were defined correctly, without missing assignments.
- Simulations: The module successfully passes the standard Test Benches (Behavioral and Post-Synthesis) and personalized corner-case simulations (e.g., asynchronous post-reset recovery or extreme variations in address length).