Giter VIP home page Giter VIP logo

launcher's Introduction

launcher

Python script to launch Windows CLI pogram that need access to USB ports for Xilinx 1525 FPGA cards. The script will get a list of FPGA cards, lock them out by opening the corresponding COM port, and release the ports one by one while running Window CLI instances that talk to the FPGA cards.

8 Apr 2019:
The script can program partial bitstreams by adding them in a batch file

---- Sample batch file for partial bitstreams ----
cd c:\users\xxxx\desktop\bitstreams
launch.py -b bs_top.bit
launch.py -b bs0.bit
launch.py -b bs1.bit
launch.py -b bs2.bit
launch.py -b bs3.bit
.....
launch.py -b bsn.bit
---- end of sample ----

30 Dec 2018:
Script now can program bitstreams to cards without running Vivado
Use option -b
python launch.py -b c:\users\hashm1n3r\Desktop\BS\bitstream.bit
A card database needs to be created once using option -i
python launch.py -i
The cards are programmed sequentially, and require a working installation of Vivado Lab.
The script uses the xsdb binary from Vivado to program the cards. There is still the time delay when Vivado hardware manager tries to scan for all cards in a system.
It is recommended to open Vivado and leave the hardware manager in Auto-detect before running the script, with the cards detected by Vivado. This avoid re-scanning of FPGA cards each time the script starts

instructions

Install Python 3.7 for Windows
https://www.python.org/downloads/windows/

Download the "Windows x86-64 executable installer" version Ensure "Add Python 3.7 to PATH" Option is selected on the installer

From a Command Prompt, install the pywin32 and pyserial modules:

pip install pypiwin32
pip install pyserial

Edit and change the working_dir and cmd variables at the start of the script to suit your environment.
cmd should be the name of the .cmd or .bat file to launch the CLI program

Note the double backslashes "\\" used to escape "\" in windows path
working_dir = "C:\\Users\\hashm1n3r\\Desktop";

You wil need to stop all the instances of the windows program that tries to access the FPGAs.
THe script will relaunch them all

You can execute a different program for each card. This is configured at the beginning of the script:

custom_cmd = {
"2143028XXX03C" : "nh_530.cmd",
"1280962XXX02C" : "nh_510.cmd",
"214302895XXXC" : "nh_510.cmd",
"dummy" : "dummy"
}

In this case these cards are run at different clock rates.
All other cards run the default program specified in cmd variable

You can also use custom command to run different miners.

Example:

C:\Users\hashm1n3r>python launch.py
COM4 2143028XXX03C
COM5 1280962XXX02C

Locking out card 2143028XXX03C by opening Serial Port COM4
Locking out card 1280962XXX02C by opening Serial Port COM5

Unlocking card 2143028XXX03C by closing serial port COM4
Starting CMD for card 2143028XXX03C on COM4
Unlocking card 1280962XXX02C by closing serial port COM5
Starting CMD for card 1280962XXX02C on COM5

Starting CMD for card 2143028XXX03C on COM4: nh_530.cmd
Starting CMD for card 1280962XXX02C on COM5: nh_510.cmd
C:\Users\hashm1n3r>

Remember to disable MS serial mouse detection
If you don't, some serial port might be claimed by MS as MS Serial Ballpoint Mouse http://www.taltech.com/support/entry/windows_2000_nt_serial_mice_and_missing_com_port

  • Click on the Windows start button
  • In the search box, type in: regedit and press the enter key on your keyboard
  • The Registry editor windows will open
  • Navigate to the registry key named: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sermouse
  • On the right hand side of the registry editor window you should find subkey named: start
  • Double click on the "start" subkey and modify the value of the key to: 4 and click the OK button to return to the registry editor window
  • Note: setting the "start" subkey value to 4 will disable windows from looking for serial mice at startup
  • Exit the regitstry editor window and reboot
  • launcher's People

    Contributors

    hashm1n3r avatar

    Stargazers

     avatar

    Watchers

    James Cloos avatar

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.