**************************** * * * P1V_TOOLBOX * * Version 0.1 * * March 2015 Ozpropdev * * * * Revision A * * * **************************** Overview ======== p1_toolbix is a console application that generates verilog code based on a configuration set by the user. The generated files are based on Chip's master verilog files. Depending on the configuration selected certain parts pf the codes are either modified or commented out. Any changes to the code are marked by a "<=-" with the reason for the change. All builds use an unscrambled "high" rom which allows modification via .binary files generated from Chip's original source using Propeller Tool. Installation ============ 1. Extract files in the zipped folder into a folder called "C:\P1_FPGA" 2. Run setup.exe from c:\P1_FPGA Verilog code generation example ================================ When p1_toolbox starts you will be prompted with a ">" command prompt To build a 4 Cog,64IO,3 counter,56k hub P1 on a BeMicro CV board. >new test1 >target cv >cogs 4 >video - >ctr 3 >portb + >hub 56 >dest c:\p1_fpga\demo >rom myrom >save >build >bye This will generate all the files needed in the folder c:\p1_fpga\demo In Quartus II create a new project from these files. ----------------------------------------------------------------------------------- COMMANDS ========= ? Display all available commands. Example usage >? >help Sample output: bye Exit from program cls Clear console char Enable/Disable char rom romsize Set high tom size in k save Save project target Set target FPGA board makerom Make .hex high tom file loadbin Load PASM/Spin binary file loadhex Load HEX file cogs Set number of cogs ctr Set number of counters per cog hub Set hub ram size in k mul Set PLL multiplier value div Set PLL divider value leds Invert cog leds (BeMicro boards) portb Enable PortB (64 IO) video Enable/Disable video block build Build verilog files dump HEX/ASCII dump of rom contents = Display current configuration zspin Fill spin interpreter area with 00's zboot Fill boot area with 00's zall Fill high rom with 00's spin Dump spin area boot Dummp boot area ver Set propeller Version number dest Set destination path src Set source path path Show Source/Dest paths top Set top entity name text Insert ascii text into rom image name Set project name files List saved projects ----------------------------------------------------------------------------------- = Displays the current configuration information Example usage >= Sample output: Project name : aaa.p1v Destination : c:\p1_fpga\abc Target : BeMicro CV Device : Altera Cyclone V - 5CEFA2F23C8 Program mode : JTAG Configuration device : EPCS16 Top entity name : top Cogs = 8 Counters = 3 Video is disabled Character rom is disabled Hub ram 60k High ROM size = 4k ($C000 to $FFFF) Custom High_ROM filename : cv_rom.hex PortB (64 I/O) is enabled Propeller Version number = 83 PLL multipler = 16 PLL divider = 4 Clock frequency = 200 MHz (100 MHz) Invert Cog LEDS is enabled ----------------------------------------------------------------------------------- COGS Sets the number of cogs in the P1. Valid range is 1 to 8 Example usage >cogs 4 ----------------------------------------------------------------------------------- CTR Sets the number of counters per cog. Valid range is 0 to 4. Example usage >ctr 2 *Note that more than 2 counters requires the video block to be disabled. Counter C & D registers are mapped as follows $1f0 CTRC (write only) SPR[0] in spin $1f1 CTRD (write only) SPR[1] in spin $1f2 FRQC (write only) SPR[2] in spin $1f3 FRQD (write only) SPR[3] in spin $1fe PHSC SPR[14] in spin $1ff PHSD SPR[15] in spin ----------------------------------------------------------------------------------- VIDEO Enables or disables video block Example usage >video - >video + ----------------------------------------------------------------------------------- CHAR Enables or disables the 16K chracter rom ($8000 to $BFFF) Example usage >char - >char + *Note Hub ram sizes > 32L require disabling the chracter rom. ----------------------------------------------------------------------------------- HUB Sets the hub ram size in K Valid sizes are 32,48,56 and 60 Example usage >hub 32 >hub 60 *Note Hub ram sizes > 32L require disabling the chracter rom. ----------------------------------------------------------------------------------- ROMSIZE Sets the "high" rom size in K Reducing the "high" rom to 4K removes the sin/log tables. Example usage >romsize 16 >romsize 5 *For hub ram sizes > 48k high rom needs to reduced in size. ----------------------------------------------------------------------------------- ROM Set the filename of the "high" rom hex file Example usage >rom myrom ----------------------------------------------------------------------------------- DEST Sets the destination of the verilog files built by p1v_toolbox Example Usage >dest c:\p1_fpga\demo1 ----------------------------------------------------------------------------------- SRC Set the source folder containing the "master" verilog files. Example usage >src c:\p1_fpga ----------------------------------------------------------------------------------- DUMP Hex/ascii dump of rom images. Example usage >dump e200 e220 sample output: FF00: 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D ================ FF10: 20 43 6F 70 79 72 69 67 68 74 20 32 30 30 35 20 Copyright 2005 FF20: 20 50 61 72 61 6C 6C 61 78 2C 20 49 6E 63 2E 20 Parallax, Inc. FF30: 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D ---------------- FF40: 77 77 77 2E 70 61 72 61 6C 6C 61 78 2E 63 6F 6D www.parallax.com FF50: 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D ================ FF60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FF70: 3F A5 3F C6 80 38 08 E2 38 02 E3 3F A7 3F 86 38 ?.?..8..8..?.?.8 *See also SPIN,BOOT and RUNNER commands ----------------------------------------------------------------------------------- BUILD Build verilog files based on current configuration. If the "high" rom has been changed you will be prompted to save it first. Example usage >build ----------------------------------------------------------------------------------- SAVE Save the current configuration info. If no name specified the current project name is used. Example usage >save >save demo1 *See also NAME ----------------------------------------------------------------------------------- NAME Set the name of the configuration Example usage >name demo1 *See also SAVE ----------------------------------------------------------------------------------- LOADHEX Load a HEX format file into rom space Example usage >loadhex unscrambled >loadhex myfile c000 ----------------------------------------------------------------------------------- LOADBIN Load a .binary file into rom space Preset names spin,boot can be used instead of hex addresses. Exampe usage >loadbin interpreter spin >loadbin interpreter f004 >loadbin booter.binary boot *See also ZALL,ZSPIN,ZBOOT ----------------------------------------------------------------------------------- VER Set the Propeller Version number as seen by the Propeller Tool. Valid numbers range from 1 to 255. Example usage >ver 1 >ver 10 ----------------------------------------------------------------------------------- PORTB Enables or disables PortB functions. Enabling PortB adds 32 IO pins to the existing 32 IO. PortB pins are also linked to the counter blocks. Example usage >portb + >portb - ----------------------------------------------------------------------------------- TEXT Allows text entry of strings into rom space. Useful for configuration message buried in rom Example uasge >text fe00 ozpropdev was here sample output: FE00: 6F 7A 70 72 6F 70 64 65 76 20 77 61 73 20 68 65 ozpropdev was he FE10: 72 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 re.............. FE20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ----------------------------------------------------------------------------------- TARGET Sets the target board details and defualts Available options: nano Terasic DE0-Nano de2 Terasic DE2-115 cv Arrow BeMicro CV max10 Arrow BeMicro Max10 123 Parallax 1-2-3 FPGA board Example usage >target nano >target de2 >target cv >target max10 >target 123 ----------------------------------------------------------------------------------- NEW Starts a new configuration (project) and sets name if supplied. Loads the default "high" rom image - "unscarambled.hex" Example usage >new > new demo1 *See also NAME,SAVE ----------------------------------------------------------------------------------- FILES Show all available project files Example uasge >files *Note To load a project type its name at the command prompt ----------------------------------------------------------------------------------- CLS Clears the console window Example usage >cls ----------------------------------------------------------------------------------- TOP Sets the name of the top entity. This will be the top entity in your project in Quartus. i.e "mymax10.tdf" Example usage >top mymax10 ----------------------------------------------------------------------------------- PATH Displays the source and destination folder names Example usage >path ----------------------------------------------------------------------------------- MAKEROM Builds a HEX file image of the "high" rom in the "dest" folder with the supplied name. Valid sizes 4 and 16 (K). Example usage >makerom myrom 16 >makerom demo 4 *See also ROMSIZE,ROM commands ----------------------------------------------------------------------------------- BYE Exits p1_toolbox Example usage >bye ----------------------------------------------------------------------------------- ZALL Fill high rom space with zeroes Address range from $f000 to $ffff ----------------------------------------------------------------------------------- ZSPIN Fill spin interpreter space with zeroes Address range from $f004 to $f7ff ----------------------------------------------------------------------------------- ZBOOT Fill boot area with zeroes Address range from $f800 to $ff7f ----------------------------------------------------------------------------------- SPIN Dumps spin interpreter memory from $F004 to $F7FF Equivalent to >DUMP F004 F7FF ----------------------------------------------------------------------------------- BOOT Dumps booter memory from $F800 to $FF7F Equivalent to >DUMP F004 F7FF ----------------------------------------------------------------------------------- RUNNER Dumps runner memory from $FF80 to $FFFF Equivalent to >DUMP F004 F7FF ----------------------------------------------------------------------------------- MUL Sets the PLL multiplier value. Clock speed = 50MHz * mul value / div value * 16 / 5 = 160 MHz (80 MHz) * 16 / 4 = 200 MHz (100 MHz) * 16 / 3 = 266 MHz (133 MHz) Example uasge >mul 18 Sample output: >mul 18 PLL multipler = 18 Clock frequency = 180 MHz (90 MHz) > *See also DIV ----------------------------------------------------------------------------------- DIV Sets the PLL divider value. Clock speed = 50MHz * mul value / div value * 16 / 5 = 160 MHz (80 MHz) * 16 / 4 = 200 MHz (100 MHz) * 16 / 3 = 266 MHz (133 MHz) Example uasge >div 5 Sample output: >div 3 PLL divider = 3 Clock frequency = 266.6667 MHz (133.3333 MHz) > *See also MUL -----------------------------------------------------------------------------------