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

Subversion Repositories zpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /zpu/trunk
    from Rev 95 to Rev 94
    Reverse comparison

Rev 95 → Rev 94

/zpu/example/hello world/zpuromgen Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
zpu/example/hello world/zpuromgen Property changes : Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: zpu/example/hello world/zpuromgen.exe =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: zpu/example/hello world/zpuromgen.exe =================================================================== --- zpu/example/hello world/zpuromgen.exe (revision 95) +++ zpu/example/hello world/zpuromgen.exe (nonexistent)
zpu/example/hello world/zpuromgen.exe Property changes : Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: zpu/example/hello world/zpuromgen.c =================================================================== --- zpu/example/hello world/zpuromgen.c (revision 95) +++ zpu/example/hello world/zpuromgen.c (nonexistent) @@ -1,64 +0,0 @@ -// zpuromgen.c -// -// Program to turn a binary file into a VHDL lookup table. -// by Adam Pierce -// 29-Feb-2008 -// -// This software is free to use by anyone for any purpose. -// -// To build: -// -// gcc -Wall zpuromgen.c -o zpuromgen - -#include -#include -#include -#include -#include - - -int main(int argc, char **argv) -{ - u_int8_t opcode[4]; - int fd; - int addr = 0; - ssize_t s; - -// Check the user has given us an input file. - if(argc < 2) - { - printf("Usage: %s \n\n", argv[0]); - return 1; - } - -// Open the input file. - fd = open(argv[1], 0); - if(fd == -1) - { - perror("File Open"); - return 2; - } - - while(1) - { - // Read 32 bits. - s = read(fd, opcode, 4); - if(s == -1) - { - perror("File read"); - return 3; - } - - if(s == 0) - break; // End of file. - - // Output to STDOUT. - printf("%6d => x\"%02x%02x%02x%02x\",\n", - addr++, opcode[0], opcode[1], - opcode[2], opcode[3]); - } - - close(fd); - return 0; -} - Index: zpu/example/hello world/build.sh =================================================================== --- zpu/example/hello world/build.sh (revision 95) +++ zpu/example/hello world/build.sh (nonexistent) @@ -1,6 +0,0 @@ -set -e -zpu-elf-gcc -O3 -phi "`pwd`/hello.c" -o hello.elf -Wl,--relax -Wl,--gc-sections -g -zpu-elf-objcopy -O binary hello.elf hello.bin -cat >../helloworld.vhd helloworld.vhd_header -./zpuromgen hello.bin >>../helloworld.vhd -cat >>../helloworld.vhd helloworld.vhd_footer Index: zpu/example/hello world/helloworld.vhd_footer =================================================================== --- zpu/example/hello world/helloworld.vhd_footer (revision 95) +++ zpu/example/hello world/helloworld.vhd_footer (nonexistent) @@ -1,37 +0,0 @@ - others => x"00000000" -); - -begin - -process (clk) -begin - if (clk'event and clk = '1') then - if (memAWriteEnable = '1') and (memBWriteEnable = '1') and (memAAddr=memBAddr) and (memAWrite/=memBWrite) then - report "write collision" severity failure; - end if; - - if (memAWriteEnable = '1') then - ram(to_integer(unsigned(memAAddr))) := memAWrite; - memARead <= memAWrite; - else - memARead <= ram(to_integer(unsigned(memAAddr))); - end if; - end if; -end process; - -process (clk) -begin - if (clk'event and clk = '1') then - if (memBWriteEnable = '1') then - ram(to_integer(unsigned(memBAddr))) := memBWrite; - memBRead <= memBWrite; - else - memBRead <= ram(to_integer(unsigned(memBAddr))); - end if; - end if; -end process; - - - - -end dualport_ram_arch;

powered by: WebSVN 2.1.0

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