This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GHDL simulation makefile | |
# This requires the top level entity to have "_tb" as a suffix. | |
# VHDL compiler | |
VHDLC = ghdl | |
# Our waveform viewer | |
WAVEVIEWER = gtkwave | |
WORKDIR = work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <inttypes.h> | |
/* Credit to https://stackoverflow.com/questions/111928/is-there-a-printf-converter-to-print-in-binary-format */ | |
#define BYTE_TO_BIN_FORMAT "%c%c%c%c%c%c%c%c" | |
#define BYTE_TO_BIN(byte) \ | |
((byte) & 0x80 ? '1' : '0'), \ | |
((byte) & 0x40 ? '1' : '0'), \ | |
((byte) & 0x20 ? '1' : '0'), \ |