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

Subversion Repositories pavr

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /pavr/trunk/tools/build_vhdl_hdr
    from Rev 4 to Rev 6
    Reverse comparison

Rev 4 → Rev 6

/run.tcl
0,0 → 1,7
set fNames [glob ../../src/*.vhd]
 
foreach {fName} "$fNames" {
set points ...
puts "Modifying file $fName$points"
exec build_vhdl_hdr.exe $fName template_hdr
}
/clean.bat
0,0 → 1,6
del *.exe
del *.obj
del *.bpf
 
del *.tds
del ..\..\src\*~
clean.bat Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: projman.tcl =================================================================== --- projman.tcl (nonexistent) +++ projman.tcl (revision 6) @@ -0,0 +1,2 @@ +source ../common/projman.tcl +wm title . "Header modifier tool" Index: template_hdr =================================================================== --- template_hdr (nonexistent) +++ template_hdr (revision 6) @@ -0,0 +1,30 @@ +-- Project +-- pAVR (pipelined AVR) is an 8 bit RISC controller, compatible with Atmel's +-- AVR core, but about 3x faster in terms of both clock frequency and MIPS. +-- The increase in speed comes from a relatively deep pipeline. The original +-- AVR core has only two pipeline stages (fetch and execute), while pAVR has +-- 6 pipeline stages: +-- 1. PM (read Program Memory) +-- 2. INSTR (load Instruction) +-- 3. RFRD (decode Instruction and read Register File) +-- 4. OPS (load Operands) +-- 5. ALU (execute ALU opcode or access Unified Memory) +-- 6. RFWR (write Register File) +-- Version +-- 0.32 +-- Date +-- 2002 August 07 +-- Author +-- Doru Cuturela, doruu@yahoo.com +-- License +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Index: run.bat =================================================================== --- run.bat (nonexistent) +++ run.bat (revision 6) @@ -0,0 +1 @@ +tclsh83 run.tcl
run.bat Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: build_vhdl_hdr.c =================================================================== --- build_vhdl_hdr.c (nonexistent) +++ build_vhdl_hdr.c (revision 6) @@ -0,0 +1,72 @@ +#include +#include +#include +#include +#include +#include "../common/tagScan.h" + +#define TAG_FILE_HDR_BEGIN "-- " +#define TAG_FILE_HDR_END "-- " +#define TAG_FILE_INFO_BEGIN "-- " +#define TAG_FILE_INFO_END "-- " +#define TAG_FILE_BODY_BEGIN "-- " +#define TAG_FILE_BODY_END "-- " + +#define TAGGED_PARAGRAPHS_SEPARATOR "\n\n\n\n" + + + +int main(int argc, char * argv[]) { + FILE *fStr1; + scanTag_t stag; + long int pos1, pos2; + char *tStr1, *tStr2; + char chr; + + if (argc > 2) + { + scanTag_t_construct(&stag); + + fStr1 = fopen(argv[2], "rb"); + if (fStr1 != NULL) + { + fseek(fStr1, 0L, SEEK_SET); + pos1 = ftell(fStr1); + fseek(fStr1, 0L, SEEK_END); + pos2 = ftell(fStr1); + + // Make room for template header, 2x(CR+LF), and string terminator. + tStr1 = (char *) malloc(pos2-pos1+4+2); + tStr2 = (char *) malloc(1+2); + strcpy(tStr1, "\n"); + fseek(fStr1, 0L, SEEK_SET); + while (feof(fStr1) == 0) + { + fread(&chr, 1, 1, fStr1); + if (feof(fStr1) == 0) + { + sprintf(tStr2, "%c", chr); + strcat(tStr1, tStr2); + } + } + + // Scan VHDL source and modify the paragraph tagged by `-- ' `-- '. + scanTag_t_writeTaggedText(TAG_FILE_HDR_BEGIN, TAG_FILE_HDR_END, tStr1, argv[1], &stag); + free(tStr1); + free(tStr2); + } + else + { + exit(1); + } + + + fprintf(stdout, "status=%s\n", scanTag_t_getStatus(&stag)); + scanTag_t_destruct(&stag); + } + else + { + fprintf(stdout, "Usage: this_executable vhdl_src template_hdr\n"); + } + return 0; +} Index: edit.bat =================================================================== --- edit.bat (nonexistent) +++ edit.bat (revision 6) @@ -0,0 +1 @@ +textpad build_vhdl_hdr.c
edit.bat Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: compile.bat =================================================================== --- compile.bat (nonexistent) +++ compile.bat (revision 6) @@ -0,0 +1 @@ +bcc32 build_vhdl_hdr.c ../common/tagScan.c
compile.bat Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property

powered by: WebSVN 2.1.0

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