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

Subversion Repositories copyblaze

Compare Revisions

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

Rev 54 → Rev 55

/trunk/copyblaze/sw/code/pbcc/demo/demo.c
0,0 → 1,42
//#include <stdio.h>
 
void __port_write(char port, char arg) { }
char __port_read(char port) { }
void __nop() { }
 
#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 (;;) {
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 ch = 0x31;
LCD_init();
while (1) {
LCD_write(ch);
delay_ms(1000);
}
}
/trunk/copyblaze/sw/code/pbcc/demo/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 = demo.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.