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

Subversion Repositories socgen

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

/socgen/trunk/doc/install/ubuntu_9.04.txt
0,0 → 1,67
================================================================
Install recipe for ubuntu 9.04 on asus M2N68-AM SE2 with 22" lcd
================================================================
 
Install ubuntu 9.04
 
 
System --> Administration --> Hardware Drivers
activate recomended nvidia driver
 
This set up the usb for urjtag
sudo cp -r etc /
 
 
cp files in socgen/bin to your local ~/bin directory.
 
add to .profile:
 
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
 
 
 
Reboot
 
 
 
System --> Administration --> Software Sources
Download from << find a local source for files>>
 
System --> Administration --> update Manager
update
 
 
System --> Administration --> Package Manager
apt-get flashplugin-nonfree
apt-get ubuntu-restricted-extras
apt-get emacs
apt-get xemacs
apt-get subversion
apt-get tkdiff
apt-get build-essential
apt-get fxload
apt-get libftdi-dev
apt-get xutils-dev
apt-get bison
apt-get flex
apt-get texinfo
apt-get libncurses5-dev
apt-get gtkterm
apt-get gtkwave
apt-get gperf
apt-get sdcc
apt-get ghdl
apt-get csh
 
 
External tools that must be obtained from the net and installed
 
 
icarus verilog verilog-0.9.1.tar.gz
 
Verilog preprocessor Verilog-Perl-3.223.tar.gz
 
xilinx web pack version 10.1
socgen/trunk/doc/install/ubuntu_9.04.txt Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: socgen/trunk/doc/install/etc/udev/rules.d/40-basic-permissions.rules =================================================================== --- socgen/trunk/doc/install/etc/udev/rules.d/40-basic-permissions.rules (nonexistent) +++ socgen/trunk/doc/install/etc/udev/rules.d/40-basic-permissions.rules (revision 3) @@ -0,0 +1,2 @@ +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="plugdev" +
socgen/trunk/doc/install/etc/udev/rules.d/40-basic-permissions.rules Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: socgen/trunk/lib/cde_sram/cde_sram.v =================================================================== --- socgen/trunk/lib/cde_sram/cde_sram.v (nonexistent) +++ socgen/trunk/lib/cde_sram/cde_sram.v (revision 3) @@ -0,0 +1,113 @@ +/**********************************************************************/ +/* */ +/* ------- */ +/* / SOC \ */ +/* / GEN \ */ +/* / LIB \ */ +/* ============== */ +/* | | */ +/* |____________| */ +/* */ +/* Generic model for a syncronous read/write memory with seperate */ +/* read and write ports. */ +/* */ +/* Author(s): */ +/* - John Eaton, jt_eaton@opencores.org */ +/* */ +/**********************************************************************/ +/* */ +/* Copyright (C) <2010> */ +/* */ +/* This source file may be used and distributed without */ +/* restriction provided that this copyright statement is not */ +/* removed from the file and that any derivative work contains */ +/* the original copyright notice and the associated disclaimer. */ +/* */ +/* This source file is free software; you can redistribute it */ +/* and/or modify it under the terms of the GNU Lesser General */ +/* Public License as published by the Free Software Foundation; */ +/* either version 2.1 of the License, or (at your option) any */ +/* later version. */ +/* */ +/* This source 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 Lesser General Public License for more */ +/* details. */ +/* */ +/* You should have received a copy of the GNU Lesser General */ +/* Public License along with this source; if not, download it */ +/* from http://www.opencores.org/lgpl.shtml */ +/* */ +/**********************************************************************/ + + + + +module cde_sram #( + parameter ADDR = 10, // Bits in addr + parameter WIDTH = 8, // Bits in data + parameter WORDS = 1024, // Number of words + parameter DEFAULT = {WIDTH{1'b1}}, // Output when not reading + parameter INIT_FILE = "NONE" // + + ) ( + input wire clk, + input wire CS, + input wire [ADDR-1:0] WR_Add, + input wire [ADDR-1:0] RD_Add, + input wire WR, + input wire RD, + input wire [WIDTH-1:0] Write_Data, + output reg [WIDTH-1:0] Read_Data + ); + +reg [WIDTH-1:0] mem[0:WORDS-1]; + +// If used as Rom then load a memory image at startup +initial + begin + if( INIT_FILE == "NONE") + begin + end + else $readmemh(INIT_FILE, mem); + end + + + +// Function to access GPRs (for use by Verilator). No need to hide this one +// from the simulator, since it has an input (as required by IEEE 1364-2001). +function [31:0] get_gpr; +// verilator public + input [ADDR-1:0] gpr_no; + get_gpr = mem[gpr_no]; + +endfunction // get_gpr + + + +// Write function +always@(posedge clk) + if( WR && CS ) mem[WR_Add[ADDR-1:0]] <= Write_Data[WIDTH-1:0]; + + +// Read function +always@(posedge clk) + if( RD && CS ) Read_Data <= mem[{RD_Add[ADDR-1:0]}]; + else Read_Data <= DEFAULT; + + +endmodule + + + + + + + + + + + + + Index: socgen/trunk/bin/hex2abs12 =================================================================== --- socgen/trunk/bin/hex2abs12 (nonexistent) +++ socgen/trunk/bin/hex2abs12 (revision 3) @@ -0,0 +1,211 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* Converts a intel hex file into a 12 bit verilog readmemh format */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010> */ +#/* */ +#/* This source file may be used and distributed without */ +#/* restriction provided that this copyright statement is not */ +#/* removed from the file and that any derivative work contains */ +#/* the original copyright notice and the associated disclaimer. */ +#/* */ +#/* This source file is free software; you can redistribute it */ +#/* and/or modify it under the terms of the GNU Lesser General */ +#/* Public License as published by the Free Software Foundation; */ +#/* either version 2.1 of the License, or (at your option) any */ +#/* later version. */ +#/* */ +#/* This source 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 Lesser General Public License for more */ +#/* details. */ +#/* */ +#/* You should have received a copy of the GNU Lesser General */ +#/* Public License along with this source; if not, download it */ +#/* from http://www.opencores.org/lgpl.shtml */ +#/* */ +#/**********************************************************************/ + +# ToDO: add handling unaligned words + + +############################################################################ +# General PERL config +############################################################################ +use Getopt::Long; +use English; +use File::Basename; + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +############################################################################ +### Process the options +############################################################################ + +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h" +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( ($opt_h eq "1") ) + { print "\n type> hex2abs12 prog_name ( no extension)"; + print "\n"; + exit 1; + } + + + +############################################################################# +## +## open intel hex file and read into array +## +############################################################################# + + my $prog_name = $ARGV[0]; + + my $input_file = ${prog_name}.".hex"; + my $output_file = ${prog_name}.".abs12"; + + + print "Reading hex File $input_file\n"; + print "Writing abs File $output_file\n"; + + + open VERILOG , "> $output_file"; + open FILE, $input_file; + + open DEFINES , "> ROM_defines.v"; + + while(){push @intel_hex, $_ ;} + + +############################################################################# +## +## Clear a storage area for the 12 bit words +## +############################################################################# + + + my $x=0; + while( $x <= 65535) + { + @Mem[$x] = "000"; + $x = $x+1; + } + + +############################################################################# +## +## Parse Data into storage converting from 8 bit bytes to 16 bit words +## +############################################################################# + +my $pointer = 0; +my $max_pointer = 0; +my $start_address = 65536; + + + foreach $line (@intel_hex) + { + $colon = substr($line, 0,1); + $length = (cvt(substr($line, 1,1))* 16) + cvt(substr($line, 2,1)); + $address = cvt(substr($line, 3,1)); + $address = cvt(substr($line, 4,1))+($address *16) ; + $address = cvt(substr($line, 5,1))+($address *16) ; + $address = cvt(substr($line, 6,1))+($address *16) ; + $type = substr($line, 7,2); + + + + if(($type eq "00") ) + + { + if( $address <= $start_address) {$start_address = $address;} + $x=9; + while( $x <= 7+($length *2)) + { + $value_E = substr($line, $x,2); + $value_O = substr($line, $x+3,1); + $pointer = (($address/2) +($x-9)/4); + if( $pointer > $max_pointer ) {$max_pointer = $pointer} + @Mem[$pointer] = $value_O.$value_E; + $x= $x+4; + } + + + } + + + + + } + + +############################################################################# +## +## dump out up to the last word, undefined space is 000 +## +############################################################################# + + $x = ($start_address/2); + while( $x <= ($max_pointer)) + { + printf VERILOG ("%s\n",@Mem[$x]); + $x = $x+1; + } + + + $words = ($max_pointer) - ($start_address/2)+1; + printf DEFINES ("`define PROG_FILE /${prog_name}.abs12\n" ); + printf DEFINES ("`define ROM_WIDTH 12\n" ); + printf DEFINES ("`define ROM_WORDS $words \n" ); + + +############################################################################# +## +## convert 0-9,A-F to decimal or 0 if out of range +## +############################################################################# + + +sub cvt { + +$temp = ord($_[0]); +if( $temp <= 48) { return 0 } +if( $temp <= 58) { return $temp - 48 } +if( $temp <= 64) { return 0 } +if( $temp <= 70) { return ($temp - 65)+10 } +return 0; + + + +} + + + + +1 + +
socgen/trunk/bin/hex2abs12 Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: socgen/trunk/bin/hex2abs16 =================================================================== --- socgen/trunk/bin/hex2abs16 (nonexistent) +++ socgen/trunk/bin/hex2abs16 (revision 3) @@ -0,0 +1,211 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* Converts a intel hex file into a 16 bit verilog readmemh format */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010> */ +#/* */ +#/* This source file may be used and distributed without */ +#/* restriction provided that this copyright statement is not */ +#/* removed from the file and that any derivative work contains */ +#/* the original copyright notice and the associated disclaimer. */ +#/* */ +#/* This source file is free software; you can redistribute it */ +#/* and/or modify it under the terms of the GNU Lesser General */ +#/* Public License as published by the Free Software Foundation; */ +#/* either version 2.1 of the License, or (at your option) any */ +#/* later version. */ +#/* */ +#/* This source 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 Lesser General Public License for more */ +#/* details. */ +#/* */ +#/* You should have received a copy of the GNU Lesser General */ +#/* Public License along with this source; if not, download it */ +#/* from http://www.opencores.org/lgpl.shtml */ +#/* */ +#/**********************************************************************/ + +# ToDO: add handling unaligned words + + +############################################################################ +# General PERL config +############################################################################ +use Getopt::Long; +use English; +use File::Basename; + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +############################################################################ +### Process the options +############################################################################ + +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h" +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( ($opt_h eq "1") ) + { print "\n type> hex2abs16 prog_name ( no extension)"; + print "\n"; + exit 1; + } + + + +############################################################################# +## +## open intel hex file and read into array +## +############################################################################# + + my $prog_name = $ARGV[0]; + + my $input_file = ${prog_name}.".hex"; + my $output_file = ${prog_name}.".abs16"; + + + print "Reading hex File $input_file\n"; + print "Writing abs File $output_file\n"; + + + open VERILOG , "> $output_file"; + open FILE, $input_file; + + open DEFINES , "> ROM_defines.v"; + + while(){push @intel_hex, $_ ;} + + +############################################################################# +## +## Clear a storage area for the 16 bit words +## +############################################################################# + + + my $x=0; + while( $x <= 65535) + { + @Mem[$x] = "0000"; + $x = $x+1; + } + + +############################################################################# +## +## Parse Data into storage converting from 8 bit bytes to 16 bit words +## +############################################################################# + +my $pointer = 0; +my $max_pointer = 0; +my $start_address = 65536; + + + foreach $line (@intel_hex) + { + $colon = substr($line, 0,1); + $length = (cvt(substr($line, 1,1))* 16) + cvt(substr($line, 2,1)); + $address = cvt(substr($line, 3,1)); + $address = cvt(substr($line, 4,1))+($address *16) ; + $address = cvt(substr($line, 5,1))+($address *16) ; + $address = cvt(substr($line, 6,1))+($address *16) ; + $type = substr($line, 7,2); + + + + if(($type eq "00") ) + + { + if( $address <= $start_address) {$start_address = $address;} + $x=9; + while( $x <= 7+($length *2)) + { + $value_E = substr($line, $x,2); + $value_O = substr($line, $x+2,2); + $pointer = (($address/2) +($x-9)/4); + if( $pointer > $max_pointer ) {$max_pointer = $pointer} + @Mem[$pointer] = $value_O.$value_E; + $x= $x+4; + } + + + } + + + + + } + + +############################################################################# +## +## dump out up to the last word, undefined space is 000 +## +############################################################################# + + $x = ($start_address/2); + while( $x <= ($max_pointer)) + { + printf VERILOG ("%s\n",@Mem[$x]); + $x = $x+1; + } + + + $words = ($max_pointer) - ($start_address/2)+1; + printf DEFINES ("`define PROG_FILE /${prog_name}.abs16\n" ); + printf DEFINES ("`define ROM_WIDTH 16\n" ); + printf DEFINES ("`define ROM_WORDS $words \n" ); + + +############################################################################# +## +## convert 0-9,A-F to decimal or 0 if out of range +## +############################################################################# + + +sub cvt { + +$temp = ord($_[0]); +if( $temp <= 48) { return 0 } +if( $temp <= 58) { return $temp - 48 } +if( $temp <= 64) { return 0 } +if( $temp <= 70) { return ($temp - 65)+10 } +return 0; + + + +} + + + + +1 + +
socgen/trunk/bin/hex2abs16 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.