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

Subversion Repositories tinyvliw8

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 5 to Rev 6
    Reverse comparison

Rev 5 → Rev 6

/tinyvliw8/trunk/tools/asm/src/asm.c
1,3 → 1,31
/**
* \file asm.c
* \author Oliver Stecklina <stecklina@ihp-microelectronics.com>
* \date 12.12.2015
*
* \brief main program file of the tinyVLIW8 assembler
*
* <p>
* Copyright (C) 2015 IHP GmbH, Frankfurt (Oder), Germany
*
* This code is free software. It is licensed under the EUPL, Version 1.1
* or - as soon they will be approved by the European Commission - subsequent
* versions of the EUPL (the "License").
* You may redistribute this code and/or modify it under the terms of this
* License.
* You may not use this work except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://joinup.ec.europa.eu/software/page/eupl/licence-eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
 
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
/tinyvliw8/trunk/tools/asm/src/list.h
1,3 → 1,31
/**
* \file list.h
* \author Oliver Stecklina <stecklina@ihp-microelectronics.com>
* \date 12.12.2015
*
* \brief Simple douple linked list implementation.
*
* <p>
* Copyright (C) 2015 IHP GmbH, Frankfurt (Oder), Germany
*
* This code is free software. It is licensed under the EUPL, Version 1.1
* or - as soon they will be approved by the European Commission - subsequent
* versions of the EUPL (the "License").
* You may redistribute this code and/or modify it under the terms of this
* License.
* You may not use this work except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://joinup.ec.europa.eu/software/page/eupl/licence-eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
 
#ifndef LIST_H
#define LIST_H
 
/tinyvliw8/trunk/tools/asm/src/parser.y
1,3 → 1,31
/**
* \file parser.y
* \author Oliver Stecklina <stecklina@ihp-microelectronics.com>
* \date 12.12.2015
*
* \brief Yacc parser file
*
* <p>
* Copyright (C) 2015 IHP GmbH, Frankfurt (Oder), Germany
*
* This code is free software. It is licensed under the EUPL, Version 1.1
* or - as soon they will be approved by the European Commission - subsequent
* versions of the EUPL (the "License").
* You may redistribute this code and/or modify it under the terms of this
* License.
* You may not use this work except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://joinup.ec.europa.eu/software/page/eupl/licence-eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
 
%{
#include <stdio.h>
#include <string.h>
/tinyvliw8/trunk/tools/asm/src/instr.h
1,3 → 1,31
/**
* \file instr.h
* \author Oliver Stecklina <stecklina@ihp-microelectronics.com>
* \date 12.12.2015
*
* \brief Instruction decoder
*
* <p>
* Copyright (C) 2015 IHP GmbH, Frankfurt (Oder), Germany
*
* This code is free software. It is licensed under the EUPL, Version 1.1
* or - as soon they will be approved by the European Commission - subsequent
* versions of the EUPL (the "License").
* You may redistribute this code and/or modify it under the terms of this
* License.
* You may not use this work except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://joinup.ec.europa.eu/software/page/eupl/licence-eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
 
#ifndef INSTR_H
#define INSTR_H
 
/tinyvliw8/trunk/tools/asm/src/main.c
1,9 → 1,29
/**
* \file main.c
* \date 22.10.2013
* \author Oliver Stecklina <stecklina@ihp-microelectronics.com>
* \date 20.10.2013
*
* \brief IHPvliw8 assembler main program file.
*
* \brief IHPvliw8 assembler main program file.
* <p>
* Copyright (C) 2015 IHP GmbH, Frankfurt (Oder), Germany
*
* This code is free software. It is licensed under the EUPL, Version 1.1
* or - as soon they will be approved by the European Commission - subsequent
* versions of the EUPL (the "License").
* You may redistribute this code and/or modify it under the terms of this
* License.
* You may not use this work except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://joinup.ec.europa.eu/software/page/eupl/licence-eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
 
#include <sys/types.h>
/tinyvliw8/trunk/tools/asm/src/config.h
1,3 → 1,31
/**
* \file config.h
* \author Oliver Stecklina <stecklina@ihp-microelectronics.com>
* \date 12.12.2015
*
* \brief Global configuration file
*
* <p>
* Copyright (C) 2015 IHP GmbH, Frankfurt (Oder), Germany
*
* This code is free software. It is licensed under the EUPL, Version 1.1
* or - as soon they will be approved by the European Commission - subsequent
* versions of the EUPL (the "License").
* You may redistribute this code and/or modify it under the terms of this
* License.
* You may not use this work except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://joinup.ec.europa.eu/software/page/eupl/licence-eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
 
#ifndef CONFIG_H
#define CONFIG_H
 
/tinyvliw8/trunk/tools/asm/src/Makefile
1,10 → 1,13
include ../defs.mk
 
PROG := asm
 
FLEX := flex
BISON := bison
 
TMPSRC := parser.c parser.h tokens.c
OBJS := asm.o parser.o tokens.o
 
all: $(PROG)
 
.l.c:
$(FLEX) -o $@ $<
 
11,5 → 14,13
.y.c:
$(BISON) -v -d -o $@ $<
 
include ../rules.mk
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
 
.c.o:
$(CC) $(CFLAGS) $(INCDIR) -c $<
 
clean:
@rm -f $(PROG) $(TMPSRC)
@rm -f $(OBJS)
@rm -f *.output
/tinyvliw8/trunk/tools/asm/src/tokens.l
1,116 → 1,62
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +/** + * \file tokens.l + */ + +%{ +# include "parser.h" + extern void nextline(); + extern void yyerror(const char *s); + + // extern int yylval; +%} + +%% +".equ" { return CONSTSEC; } +".res" { return RESSEC; } +".code" { return CODESEC; } +".irq"[0-3] { yylval.num = yytext[4] - '0'; return IRQSEC; } +"ldi" { return LOADI; } +"ld" { return LOAD; } +"sti" { return STOREI; } +"st" { return STORE; } +"rla" { return RLA; } +"rlc" { return RLC; } +"rra" { return RRA; } +"rrc" { return RRC; } +"mov" { return MOVE; } +"addi" { return ADDI; } +"add" { return ADD; } +"or" { return OR; } +"xor" { return XOR; } +"xnor" { return XNOR; } +"nor" { return NOR; } +"and" { return AND; } +"nand" { return NAND; } +"jmp" { return JMP; } +"jnz" { return JNZ; } +"jz" { return JZ; } +"jc" { return JC; } +":" { return COLON; } +";" { return SEMICOLON; } +"+" { return PLUS; } +"-" { return MINUS; } +"~" { return TILDE; } +"|" { return PIPE; } +"$" { return DOLLAR; } +"#" { return HASH; } +"@" { return AT; } +"," { return COMMA; } +r[0-7] { yylval.num = yytext[1] - '0'; return REG; } +0x[0-9a-f][0-9a-f] { yylval.num = strtol(&yytext[2], 0, 16); return HEXNUM; } +0x[0-7][0-9a-f][0-9a-f] { yylval.num = strtol(&yytext[2], 0, 16); return HEXADDR; } +[_0-9a-z]+ { yylval.str = strdup(yytext); return NAME; } +[A-Z]+ { yylval.str = strdup(yytext); return UNAME; } +[ \r\t] { ; } +\n { nextline(); return NEWLINE;} +"//".*\n { nextline(); return NEWLINE;} +. { yyerror("illegal token\n"); } +%% +#ifndef yywrap +yywrap() { return 1; } +#endif +

powered by: WebSVN 2.1.0

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