diff --git a/README.md b/README.md index 47f5626..52376eb 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,60 @@ -# English +# Entity: GenericCounter -## VHDL Project Template Using Xilinx Build Tools with Makefile +- **File**: [GenericCounter.vhd](src/GenericCounter.vhd) -Welcome to the VHDL Project Template repository. This project is designed to streamline your FPGA development process using the Xilinx ISE Build Tools, integrated with a convenient Makefile approach for building and synthesizing your VHDL designs. +## Diagram -### Using the Makefile +![Diagram](docs/GenericCounter.svg "Diagram") -To use the Makefile for building your VHDL projects, ensure you have the Xilinx Build Tools installed on your system. The Makefile is specifically configured to work with these tools to automate the build process. +## Description -For detailed instructions on how to use the Makefile, please refer to the following URL: [Xilinx ISE Makefile](https://github.com/PxaMMaxP/Xilinx-ISE-Makefile). This page contains comprehensive guidance on setup and usage to get you started quickly. +- Name: Generic Counter
+- Version: 0.0.2
+- Author: **Maximilian Passarello ([Blog](mpassarello.de))**
+- License: [MIT](LICENSE)
-### Directory Structure +Generic Counter with the following features: -The project is organized into various subdirectories, each serving a specific role in the development process. +- **Without Output Register** +- Look ahead value (configurable per generic) +- Synchronous reset +- Clock enable +- Set with priority over the `CountEnable` +- Over- and Underflow flag +- Configurable width +- Configurable initial value +- Configurable reset value +- Configurable counting direction (Up and Down counting) -#### `lib` Directory +## History -This directory is intended for individual modules of the project. Each module should be placed in its own subdirectory within the `lib` directory. This structure helps to keep the project organized and makes it easier to locate specific modules. +- 0.0.1 (2024-03-15) Initial version +- 0.0.2 (2024-03-16) Added Testbench. Simulation passed. -#### `code` Directory +## Waveform -This directory is intended for project-specific VHDL codes. Modules, on the other hand, should be placed in the subdirectory `../lib`. +![alt text](docs/wavedrom_VDiF0.svg "title") -### Getting Started +## Generics -To begin using this VHDL Project Template, clone the repository to your local machine and follow the instructions provided in the subdirectory `README.md` files to understand the project layout. Then, head over to the URL mentioned above for details on using the Makefile with the Xilinx Build Tools. +| Generic name | Type | Value | Description | +| ----------------- | ------- | ----- | ---------------------------------- | +| Width | integer | 4 | Width of the counter | +| InitialValue | integer | 0 | Initial value of the counter | +| ResetValue | integer | 0 | Reset value of the counter | +| CountingDirection | string | "UP" | Counting direction: "UP" or "DOWN" | +| LookAhead | integer | 0 | Look ahead value | -Thank you for choosing this VHDL Project Template. We hope it accelerates your development process and helps you achieve your project goals efficiently. +## Ports ---- - -# Deutsch - -## VHDL-Projektvorlage unter Verwendung von Xilinx Build Tools mit Makefile - -Willkommen im Repository der VHDL-Projektvorlage. Dieses Projekt wurde entwickelt, um Ihren FPGA-Entwicklungsprozess mit den Xilinx ISE Build Tools zu vereinfachen, integriert mit einem praktischen Makefile-Ansatz zum Bauen und Synthetisieren Ihrer VHDL-Designs. - -### Verwendung des Makefiles - -Um das Makefile für den Bau Ihrer VHDL-Projekte zu verwenden, stellen Sie sicher, dass die Xilinx Build Tools auf Ihrem System installiert sind. Das Makefile ist speziell so konfiguriert, dass es mit diesen Tools arbeitet, um den Bauprozess zu automatisieren. - -Für detaillierte Anweisungen zur Verwendung des Makefiles besuchen Sie bitte die folgende URL: [Xilinx ISE Makefile](https://github.com/PxaMMaxP/Xilinx-ISE-Makefile). Diese Seite enthält umfassende Anleitungen zur Einrichtung und Verwendung, damit Sie schnell starten können. - -### Verzeichnisstruktur - -Das Projekt ist in verschiedene Unterverzeichnisse organisiert, von denen jedes eine spezifische Rolle im Entwicklungsprozess spielt. - -#### `lib` Verzeichnis - -Dieses Verzeichnis ist für einzelne Module des Projekts vorgesehen. Jedes Modul sollte in seinem eigenen Unterordner innerhalb des `lib` Verzeichnisses platziert werden. Diese Struktur hilft, das Projekt organisiert zu halten und erleichtert das Auffinden spezifischer Module. - -#### `code` Verzeichnis - -Dieses Verzeichnis ist für projektspezifische VHDL-Codes vorgesehen. Module sollten hingegen im Unterordner `../lib` abgelegt werden. - -### Erste Schritte - -Um mit dieser VHDL-Projektvorlage zu beginnen, klonen Sie das Repository auf Ihre lokale Maschine und folgen Sie den Anweisungen in den `README.md`-Dateien der Unterverzeichnisse, um das Layout des Projekts zu verstehen. Anschließend besuchen Sie die oben genannte URL für Details zur Verwendung des Makefiles mit den Xilinx Build Tools. - -Vielen Dank, dass Sie sich für diese VHDL-Projektvorlage entschieden haben. Wir hoffen, dass sie Ihren Entwicklungsprozess beschleunigt und Ihnen hilft, Ihre Projektziele effizient zu erreichen. +| Port name | Direction | Type | Description | +| -------------- | --------- | ------------------------------------ | --------------------------------------------------- | +| CLK | in | std_logic | Clock input; rising edge | +| RST | in | std_logic | Reset input; active high; synchronous | +| CE | in | std_logic | Clock enable; active high | +| CountEnable | in | std_logic | Count enable; active high | +| CounterValue | out | std_logic_vector(Width - 1 downto 0) | Counter Value | +| LookAheadValue | out | std_logic_vector(Width - 1 downto 0) | Look ahead value | +| Set | in | std_logic | Set with priority over the `CountEnable` | +| SetValue | in | std_logic_vector(Width - 1 downto 0) | If set is high, the counter will be set to SetValue | +| OverUnderflow | out | std_logic | Over- and Underflow flag | diff --git a/docs/GenericCounter.svg b/docs/GenericCounter.svg new file mode 100644 index 0000000..3bf1e55 --- /dev/null +++ b/docs/GenericCounter.svg @@ -0,0 +1 @@ + integer Width integer InitialValue integer ResetValue string CountingDirection integer LookAhead std_logic CLK std_logic RST std_logic CE std_logic CountEnable std_logic Set std_logic_vector(Width - 1 downto 0) SetValue std_logic_vector(Width - 1 downto 0) CounterValue std_logic_vector(Width - 1 downto 0) LookAheadValue std_logic OverUnderflow diff --git a/docs/Waveforms/Generic Counter.json b/docs/Waveforms/Generic Counter.json new file mode 100644 index 0000000..3517808 --- /dev/null +++ b/docs/Waveforms/Generic Counter.json @@ -0,0 +1,68 @@ +{ + "signal": [ + [ + "General", + { + "name": "CLK", + "wave": "P.....|........", + "node": "0123456789abcde", + "period": 1 + }, + { + "name": "RST", + "wave": "10....|.....10." + }, + { + "name": "CE", + "wave": "0.1...|........" + } + ], + [ + "Set", + { + "name": "Set", + "wave": "0.....|..10...." + }, + { + "name": "SetValue", + "wave": "x.....|..8x....", + "data": [ + "5" + ] + } + ], + [ + "Counter", + { + "name": "CountEnable", + "wave": "0..1..|.......0" + }, + { + "name": "CounterValue", + "wave": "4..777|77777777", + "data": "0 1 2 3 15 0 5 6 7 8 1 1" + }, + { + "name": "LookAheadValue", + "wave": "4..777|77777777", + "data": "1 2 3 4 0 1 6 7 8 9 2 2" + } + ], + [ + "Flags", + { + "name": "OverUnderflow", + "wave": "0.....|.10....." + } + ] + ], + "config": { + "hscale": 1 + }, + "head": { + "text": "Generic Counter" + }, + "foot": { + "text": "RST Value = 0" + } +} \ No newline at end of file diff --git a/docs/wavedrom_VDiF0.svg b/docs/wavedrom_VDiF0.svg new file mode 100644 index 0000000..e2175f1 --- /dev/null +++ b/docs/wavedrom_VDiF0.svg @@ -0,0 +1 @@ +Generic CounterRST Value = 0CLKRSTCESetSetValue5CountEnableCounterValue0123150567811LookAheadValue123401678922OverUnderflow0123456789abcdeGeneralSetCounterFlags \ No newline at end of file diff --git a/src/GenericCounter.ucf b/src/GenericCounter.ucf new file mode 100644 index 0000000..14efc47 --- /dev/null +++ b/src/GenericCounter.ucf @@ -0,0 +1,4 @@ +#NET CLK LOC = B8; +NET CLK LOC = AG18; +NET CLK TNM_NET = CLOCK; +TIMESPEC TS_CLOCK = PERIOD CLOCK 700 MHz HIGH 50 %; \ No newline at end of file