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

Subversion Repositories copyblaze

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /copyblaze/trunk
    from Rev 53 to Rev 54
    Reverse comparison

Rev 53 → Rev 54

/copyblaze/sw/code/pbcc/asm/asm.c
0,0 → 1,17
// test of inserted asm code into C code
int i;
 
/*
asm
ENABLE_INTERRUPT;
endasm
*/
 
int main(void)
{
__asm
INPUT s0
__endasm;
i = 10;
return i;
}
/copyblaze/sw/code/pbcc/asm/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = asm.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/funstruct/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = funstruct.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/funstruct/funstruct.c
0,0 → 1,31
struct s {
int a;
char b;
} struktura;
 
int sum(char nnn1, short n2, int n3)
{
return (int)nnn1 + n2 + n3;
}
 
void main()
{
char c = 29;
short d = 57;
int e = 113;
 
 
if (sum(1, 2, 3) > 5)
{
sum(2, 3, c + d);
return;
}
else
{
struktura.a = 99;
}
struktura.a = 2*e;
struktura.b = c;
sum (struktura.b, d, e);
}
/copyblaze/sw/code/pbcc/testINOUT/testINOUT.c
0,0 → 1,20
// test INPUT/OUTPUT instrukci
volatile char gl = 5;
 
// definice portu
extern char PBLAZEPORT[];
 
void fun(char *a)
{
char i;
for(i = 0; i < *a; i++) {
PBLAZEPORT[i] = gl;
}
}
 
void main()
{
char a = PBLAZEPORT[5];
fun(&a);
 
}
/copyblaze/sw/code/pbcc/testINOUT/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = testINOUT.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/stubs/stubs.c
0,0 → 1,5
void main()
{
int i = 42;
for (;;) {i--;};
}
/copyblaze/sw/code/pbcc/stubs/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = stubs.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/funlit/funlit.c
0,0 → 1,14
char sum(char nnn1, char n2, char n3)
{
return nnn1 + n2 + n3;
}
 
 
void main()
{
char c = 29;
char d = 57;
char e = 113;
sum (c, d, e);
}
/copyblaze/sw/code/pbcc/funlit/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = funlit.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/funvar/funvar.c
0,0 → 1,11
char globvar = 13;
 
char test(char x)
{
return x;
}
 
void main()
{
test(globvar);
}
/copyblaze/sw/code/pbcc/funvar/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = funvar.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/lcd/lcd.c
0,0 → 1,54
//#include <stdio.h>
 
void __port_write(char port, char arg) { }
char __port_read(char port) { }
void __nop() { }
 
#define LED_wr(arg) __port_write(0x80, (arg))
 
#define LCD_wr(arg) __port_write(0x01, (arg))
#define LCD_rd() __port_read(0x01)
#define LCD_busy() (LCD_rd() & 0x80) == 0x80
 
void delay_ms(int ms)
{
int i;
for (i=0;i<ms;i++) {
for (i=0; i < 10000; i++) __nop();
}
}
 
void LCD_init()
{
LCD_wr(0x42);
while (LCD_rd()) { __nop();}
LCD_wr(0x43);
delay_ms(10);
LCD_wr(0x44);
LCD_wr(0x45);
}
 
void LCD_write(char ch)
{
LCD_wr(0x46);
LCD_wr(0x47);
}
 
 
int main(void) {
char st = 0;
 
while(1) {
LED_wr(st);
st ^= 1;
delay_ms(1000);
}
/*
char ch = 0x31;
LCD_init();
while (1) {
LCD_write(ch);
delay_ms(1000);
}
*/
}
/copyblaze/sw/code/pbcc/lcd/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = lcd.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/pointers/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = pointers.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/types/types.c
0,0 → 1,18
int i;
struct stype {
int x;
int y;
} str;
 
int f(char a, short b)
{
return a + b;
}
 
 
int main(void)
{
// stype lstr;
i = str.x = str.y = 13;
return f(i, str.x);
}
/copyblaze/sw/code/pbcc/types/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = types.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/simplefunc/simplefunc.c
0,0 → 1,12
char inc(char number)
{
return number + 1;
}
 
 
void main()
{
char c = 42;
inc(c);
}
/copyblaze/sw/code/pbcc/simplefunc/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = simplefunc.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/test7/test7.c
0,0 → 1,30
// test bitových operací všeho druhu (pBlazeIDE)
 
void main()
{
volatile unsigned char c = 1;
volatile unsigned char d = 1;
volatile unsigned char e = 15;
c <<= 4;
c >>= 3;
c |= c;
c |= d + 1;
c = c & d;
d = ~e;
e = c ^ d;
c = !c && d || e;
c = c || e;
if (!c)
{
c = -e;
}
}
/copyblaze/sw/code/pbcc/test7/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = test7.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/test8/test8.c
0,0 → 1,31
// switch test
 
void main()
{
volatile char c = 5;
// JUMPTABLE generated
switch(c)
{
case 10: c = 11; break;
case 11: c = 22; break;
case 12: c = 33; break;
case 13: c = 44; break;
case 14: c = 55; break;
default: c = 99;
break;
}
// sequence of IFXs generated
switch(c)
{
case 10: c = 11; break;
case 23: c = 22; break;
case 31: c = 33; break;
case 4: c = 44; break;
case 59: c = 55; break;
default: c = 99;
break;
}
 
}
/copyblaze/sw/code/pbcc/test8/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = test8.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/test9/test9.c
0,0 → 1,17
// test bitových operací - problem with NOT_OP (pBlazeIDE)
 
/* link the C libarary */
 
//#pragma library c
 
void main()
{
volatile char c = 1;
c = !c;
c = 0;
c = !c;
c = c && c;
c = c || c;
c = 29;
c = c % 13;
}
/copyblaze/sw/code/pbcc/test9/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = test9.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/intr/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = intr.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/intr/intr.c
0,0 → 1,18
// test of inserted asm code into C code
int i;
 
void ihandler() __interrupt (3) __using (7)
{
_asm
DISALBE INTERRUPT
_endasm;
}
 
int main(int x, int y)
{
_asm
INPUT s0
_endasm;
i = 10;
return i;
}
/copyblaze/sw/code/pbcc/operators/operators.c
0,0 → 1,11
int main()
{
int i = 0;
int j = 13;
zkouska:
i += 2;
j -= i;
i |= j;
goto zkouska;
return i*j;
}
/copyblaze/sw/code/pbcc/operators/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = operators.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin
/copyblaze/sw/code/pbcc/testM2/testM2.c
0,0 → 1,35
// test ruzne typy ukazatelu
 
int pole[] = {100,200,300,400};
char text[] = "Pepa";
int nepole = 6;
volatile int *vgptr;
int *gptr;
 
 
char fun( volatile char *a, int b, char c, char *d)
{
volatile char val = 0;
char t1 = *d;
val = val * c;
b = pole[3] & pole[1];
text[2] = 'R';
*d = text[3];
return t1 + b + nepole;
}
 
void main()
{
volatile char a = 10;
volatile char b = 20;
char c = 30;
gptr = &nepole;
vgptr = &nepole;
pole[1] = 150;
pole[0] = *gptr;
*vgptr = 18;
fun(&a,555,c, &c);
nepole = c;
 
}
/copyblaze/sw/code/pbcc/testM2/Makefile
0,0 → 1,60
# tools paths
DRIVE=/cygdrive/c
 
PATH_TOP=../../../..
PATH_TOOL=$(PATH_TOP)/sw/tools
PATH_ASM=asm
PATH_COMP=comp/pbcc/sdcc
 
CC=$(PATH_TOOL)/$(PATH_COMP)/bin/sdcc.exe
AS=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/pBlazASM/pBlazASM.exe
MG=$(PATH_TOOL)/$(PATH_ASM)/pBlazASM/cpBlazeMRG/cpBlazeMRG.exe
 
# output directory
DIROUT=$(PATH_TOP)/rtl/vhdl
 
# remove command
RM = rm -f -v
CP = cp
 
# Compiler Flags
C_SRC = testM2.c
CFLAGS = -mpblaze -S
IFLAGS = -I"$(PATH_TOOL)/$(PATH_COMP)/device/include/pblaze"
 
# Assembler Flags
ASM_SRC = *.psm
AFLAGS = -k -l -x
 
# Merge Flags
MGFLAGS =
ENTITY = cp_ROM_Code
 
.SUFFIXES : .psm .mem .vhd .psh
 
# ALL
all: clean $(ENTITY).vhd
 
# compile #
$(ENTITY).psm: $(C_SRC)
$(CC) $(C_SRC) $(CFLAGS) $(IFLAGS)
 
# assemble #
$(ENTITY).mem: $(ENTITY).psm
$(AS) $(ASM_SRC) $(AFLAGS)
$(CP) *.hex $(ENTITY).hex
 
# merge #
$(ENTITY).vhd: $(ENTITY).mem
$(MG) $(MGFLAGS) $(ENTITY).hex
$(CP) $(ENTITY).vhd $(DIROUT)/$(ENTITY).vhd
 
 
# clean outputs
clean:
$(RM) *.lst
$(RM) *.mem
$(RM) *.hex
$(RM) *.log
$(RM) *.vhd
$(RM) *.bin

powered by: WebSVN 2.1.0

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