OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /eco32/trunk/tools
    from Rev 41 to Rev 42
    Reverse comparison

Rev 41 → Rev 42

/dspmem/screen
0,0 → 1,30
" ",
" ",
" ",
" ",
" ",
" ",
" S i m p l e C h a r a c t e r D i s p l a y ",
" ",
" ",
" ",
" 3 0 L i n e s x 8 0 C h a r a c t e r s ",
" ",
" ",
" ",
" ",
" ",
" ",
" U n i v e r s i t y ",
" ",
" o f ",
" ",
" A p p l i e d S c i e n c e s ",
" ",
" G i e s s e n ",
" ",
" ",
" ",
" ",
" ",
" ",
/dspmem/mkinit.c
0,0 → 1,129
/*
* mkinit.c -- generate Verilog defparam statements from C data
*/
 
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
 
#define ATT_HI_FILE_NAME "dspatthi.init"
#define ATT_LO_FILE_NAME "dspattlo.init"
#define CHR_HI_FILE_NAME "dspchrhi.init"
#define CHR_LO_FILE_NAME "dspchrlo.init"
 
 
unsigned char data[][80] = {
#include "screen"
};
 
 
int main(void) {
FILE *outFile;
int i, j;
unsigned char b[64];
int index, row, col;
 
if (sizeof(data) != 30 * 80) {
printf("Error: wrong size of data\n");
exit(1);
}
outFile = fopen(ATT_HI_FILE_NAME, "w");
if (outFile == NULL) {
printf("Error: cannot open file '%s'\n", ATT_HI_FILE_NAME);
exit(1);
}
for (i = 0; i < 64; i++) {
fprintf(outFile, " defparam display_att_hi.INIT_%02X = 256'h", i);
for (j = 0; j < 64; j++) {
index = i * 64 + j;
row = index / 128;
col = index % 128;
if (0 <= row && row < 30 &&
0 <= col && col < 80) {
b[j] = 0x07;
} else {
b[j] = 0;
}
}
for (j = 63; j >= 0; j--) {
fprintf(outFile, "%01X", (b[j] >> 4) & 0x0F);
}
fprintf(outFile, ";\n");
}
fclose(outFile);
outFile = fopen(ATT_LO_FILE_NAME, "w");
if (outFile == NULL) {
printf("Error: cannot open file '%s'\n", ATT_LO_FILE_NAME);
exit(1);
}
for (i = 0; i < 64; i++) {
fprintf(outFile, " defparam display_att_lo.INIT_%02X = 256'h", i);
for (j = 0; j < 64; j++) {
index = i * 64 + j;
row = index / 128;
col = index % 128;
if (0 <= row && row < 30 &&
0 <= col && col < 80) {
b[j] = 0x07;
} else {
b[j] = 0;
}
}
for (j = 63; j >= 0; j--) {
fprintf(outFile, "%01X", (b[j] >> 0) & 0x0F);
}
fprintf(outFile, ";\n");
}
fclose(outFile);
outFile = fopen(CHR_HI_FILE_NAME, "w");
if (outFile == NULL) {
printf("Error: cannot open file '%s'\n", CHR_HI_FILE_NAME);
exit(1);
}
for (i = 0; i < 64; i++) {
fprintf(outFile, " defparam display_chr_hi.INIT_%02X = 256'h", i);
for (j = 0; j < 64; j++) {
index = i * 64 + j;
row = index / 128;
col = index % 128;
if (0 <= row && row < 30 &&
0 <= col && col < 80) {
b[j] = data[row][col];
} else {
b[j] = 0;
}
}
for (j = 63; j >= 0; j--) {
fprintf(outFile, "%01X", (b[j] >> 4) & 0x0F);
}
fprintf(outFile, ";\n");
}
fclose(outFile);
outFile = fopen(CHR_LO_FILE_NAME, "w");
if (outFile == NULL) {
printf("Error: cannot open file '%s'\n", CHR_LO_FILE_NAME);
exit(1);
}
for (i = 0; i < 64; i++) {
fprintf(outFile, " defparam display_chr_lo.INIT_%02X = 256'h", i);
for (j = 0; j < 64; j++) {
index = i * 64 + j;
row = index / 128;
col = index % 128;
if (0 <= row && row < 30 &&
0 <= col && col < 80) {
b[j] = data[row][col];
} else {
b[j] = 0;
}
}
for (j = 63; j >= 0; j--) {
fprintf(outFile, "%01X", (b[j] >> 0) & 0x0F);
}
fprintf(outFile, ";\n");
}
fclose(outFile);
return 0;
}
/dspmem/Makefile
0,0 → 1,37
#
# Makefile for generating initialization statements
# for the display's screen memory
#
 
BUILD = ../../build
 
.PHONY: all install clean
 
all: dspatthi.init dspattlo.init dspchrhi.init dspchrlo.init
 
install: dspatthi.init dspattlo.init dspchrhi.init dspchrlo.init
mkdir -p $(BUILD)/hw-dsp
cp dspatthi.init $(BUILD)/hw-dsp
cp dspattlo.init $(BUILD)/hw-dsp
cp dspchrhi.init $(BUILD)/hw-dsp
cp dspchrlo.init $(BUILD)/hw-dsp
 
dspatthi.init: mkinit
./mkinit
 
dspattlo.init: mkinit
./mkinit
 
dspchrhi.init: mkinit
./mkinit
 
dspchrlo.init: mkinit
./mkinit
 
mkinit: mkinit.c screen
gcc -m32 -g -Wall -o mkinit mkinit.c
 
clean:
rm -f *~ mkinit
rm -f dspatthi.init dspattlo.init
rm -f dspchrhi.init dspchrlo.init
/Makefile
4,7 → 4,7
 
BUILD = ../build
 
DIRS = bin2exo bin2mcs bit2exo chrgen
DIRS = bin2exo bin2mcs bit2exo chrgen dspmem
 
.PHONY: all install clean
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.