Package: siswrapper
SISWRAPPERSiswrapper is awrapper forSIS, the tool for synthesis and optimization of sequential circuits.Siswrapper enables developers to code scripts that embeds SIS in any way.Read this README in:EnglishItalianoDisclaimer:I'm not affiliated with the SIS developers in any way.The aim of this library is to enable the developers to use SIS via the Python programming language.IndexDescriptionRequirementsInstallationUsageChangelogAuthorDescriptionThis library enables the developer
tocontrol SIS via Pythonusing an istance of thesiswrapper.Siswrapperclass.This is possible thanks topexpect,
a Python library that can easily be used
to control interactive shells by spawning and connecting to their process.Go to the indexRequirementsUnix-like OSpexpect doesn't have all its features on Windows and SIS works best on linux OSesPython 3the pexpect library for Python: control interactive shells via PythonSIS, set in the path environment variable (callable with thesiscommand): the tool for synthesis and optimization of sequential circuitsYou candownload it hereGo to the indexInstallationYou can install this library by:(Easiest) Running the following pip command:pip install siswrapperBuild the python wheel file using the following command:python3 setup.py bdist_wheelAnd install the wheel by executing this command:pip install siswrapper-<version>-py3-none-any.whl<version>is siswrapper's versionGo to the indexUsageAfter siswrapper's installation you can import siswrapper
inside a script or inside the interpreter.importsiswrapperNow you can instance an object from thesiswrapper.Siswrapper()class:sis=siswrapper.Siswrapper()This instruction spawns a SIS process using pexpect.From now on it is possible to execute sis commands using Python:sis.stop()# stop SIS sessionsis.start()# start SIS session# > Executed automatically after the siswrapper.Siswrapper() instance creation# > (might be useful if you have closed SIS before using sis.stop())path="file.blif"sis.read_blif(path)# reads a blif filesis.simulate("010010")# executes a simulation# > No need for spaces between each input !!# optimize the circuit using the rugged scriptsis.script_rugged()# execute a command that is not# directly supported by this library:sis.exec("help")# try to execute a command and parse the output# without calling directly the correct method (simulate() in this case)# > In case parsed_exec() can't find the right method to call, exec() is called as a fallbacksis.parsed_exec("simulate 00 10 11")# save the circuit to a new filesis.write_blif("optimized.blif")# if necessary it is possible to interact with SIS' shellsis.interact()All the methods return a dictionary with:a success exit status (which can be False or True)errors list (empty if there were no errors)warnings list (empty if there were no warnings, only on some commands that can return warnings)stdout of the command (None if the command returns nothing)parsed output of the SIS command (on some commands that return data)Go to the indexChangelog2021-09-05 1.2.2:FixesCommands that show paginated output don't timeout anymoreAn example of command that shows paginated output is thehelp read_blifcommand.Theexec()method didn't collect thewait_end_command()method's errors properly2021-03-16 1.2.1:Fixestheprint_statsmethod failed the print_stats command output parsing when the circuit had 10000 literals/states or more2021-03-16 1.2.0:FeaturesAddedbsis_scriptcommand. Its accepted parameters are:fsm_autoencoding_area, useful for FSM circuits: minimizes states, automatically encodes states, optimizes area and maps the circuit by area (synch library)Executed commands:state_minimize stamina,state_assign jedi,source script.rugged,read_library synch.genlib,map -m 0 -W -sfsm_autoencoding_delay, useful for FSM circuits: minimizes states, automatically encodes states, optimizes delay and maps the circuit by delay (synch library)Executed commands:state_minimize stamina,state_assign jedi,reduce_depth,source script.rugged,read_library synch.genlib,map -n 1 -W -sfsm_area, useful for FSM circuits: minimizes states, uses manual states encoding, optimizes area and maps the circuit by area (synch library)Executed commands:state_minimize stamina,stg_to_network,source script.rugged,read_library synch.genlib,map -m 0 -W -sfsm_delay, useful for FSM circuits: minimizes states, uses manual states encoding, optimizes delay and maps the circuit by delay (synch library)Executed commands:state_minimize stamina,stg_to_network,reduce_depth,source script.rugged,read_library synch.genlib,map -n 1 -W -slgate_area_mcnc, useful for combinational circuits: optimizes area and maps the circuit by area (mcnc library)Executed commands:source script.rugged,read_library mcnc.genlib,map -m 0 -W -slgate_delay_mcnc, useful for combinational circuits: optimizes delay and maps the circuit by delay (mcnc library)Executed commands:reduce_depth,source script.rugged,read_library mcnc.genlib,map -n 1 -W -slgate_area_synch, useful for combinational circuits: optimizes area and maps the circuit by area (synch library)Executed commands:source script.rugged,read_library synch.genlib,map -m 0 -W -slgate_delay_synch, useful for combinational circuits: optimizes delay and maps the circuit by delay (synch library)Executed commands:reduce_depth,source script.rugged,read_library synch.genlib,map -n 1 -W -sfsmd_area, useful for FSMD circuits (circuits which include datapaths and an FSM): optimizes area and maps the circuit by area (synch library)Executed commands:source script.rugged,read_library synch.genlib,map -m 0 -W -sfsmd_delay, useful for FSMD circuits (circuits which include datapaths and an FSM): optimizes delay and maps the circuit by delay (synch library)Executed commands:reduce_depth,source script.rugged,read_library synch.genlib,map -n 1 -W -sThis command also shows which command is executed and the statistics after some commandsPartial and full results are written to new BLIF files.WARNING! These commands are executed in this order, thus does NOT guarantee the best result: multi-level minimization is not perfect!
to obtain better results you should try to execute these commands manually in a diffent order (try also to execute them more than once)Now this library verifies if the stg_to_network command is successfulFixesNow thewrite_eqnmethod is executed whenwrite_eqnis passed to theparsed_output()method.Before this fix thewrite_blifmethod was executed instead of the correct methodIf you call thewrite_eqnandwrite_blifmethod without parameters the output doesn't contain the command.When SIS is not installed the error message shows exactly what the problem isCan't execute the rugged script if no file as been read with a read commandWhen you execute a read command, this library calls theresetmethod to close the SIS session and
open a new session inside the folder of the input fileThis "fixes" the ".search x file not found" error when you try to read a file that is in another folder and contains the .search keyword.This error was normal but not intuitive (because the imported file was present inside the same folder as the input file but not inside the current folder).
It was the original SIS behaviour.2021-01-09 1.1.1:Fixes/featuressimulate()is executed byparsed_output()even with not correct input (non "0" and/or "1" chars)
and with the abbreviated commandsimsimulate()andprint_stats()can manage FSM outputs (fix:TypeError: 'NoneType' object is not subscriptable)Known bugswrite_blifcommand/method is executed whenwrite_eqnis passed to theparsed_output()method.When SIS is not installed the error message is incomplete (not easily understandable)2021-01-04 1.1.0:Added featuresAdded theparsed_output()method:
it reads a command and automatically calls the best method
to parse the output of that command.If the command is not recognized it falls back to theexec()method.ChangesThesimulate()method now returns a string with the outputs (not space between each output):there was no reason to calculate sums, subtractions, ... from the output
so the string type makes more senseFixesNow theexec()knows how to treat thequitandexitcommands without raising Exceptions.2020-11-14 1.0.0:First commitGo to the indexAuthorStefano Zenaro (mario33881)