pycaliper package
Subpackages
- pycaliper.btorinterface package
- pycaliper.frontend package
- Submodules
- pycaliper.frontend.genericpass module
- pycaliper.frontend.parsetab module
- pycaliper.frontend.pycast module
ASTBlock
ASTCondEq
ASTDimension
ASTEq
ASTExpr
ASTForLoop
ASTFunctionCall
ASTIdentifier
ASTInv
ASTModBlock
ASTModEq
ASTModIf
ASTModInput
ASTModInstance
ASTModInv
ASTModOutput
ASTModOutputState
ASTModState
ASTModStmt
ASTNumber
ASTOp
ASTOp.Add
ASTOp.ArithmeticShiftLeft
ASTOp.ArithmeticShiftRight
ASTOp.BinaryAnd
ASTOp.BinaryOr
ASTOp.BinaryXnor
ASTOp.BinaryXor
ASTOp.CaseEquality
ASTOp.CaseInequality
ASTOp.Div
ASTOp.Equality
ASTOp.GreaterThan
ASTOp.GreaterThanEqual
ASTOp.ITE
ASTOp.Inequality
ASTOp.LessThan
ASTOp.LessThanEqual
ASTOp.LogicalAnd
ASTOp.LogicalEquivalence
ASTOp.LogicalImplication
ASTOp.LogicalOr
ASTOp.LogicalShiftLeft
ASTOp.LogicalShiftRight
ASTOp.Mod
ASTOp.Mul
ASTOp.Power
ASTOp.Sub
ASTOp.UnaryBitwiseAnd
ASTOp.UnaryBitwiseNand
ASTOp.UnaryBitwiseNor
ASTOp.UnaryBitwiseNot
ASTOp.UnaryBitwiseOr
ASTOp.UnaryBitwiseXnor
ASTOp.UnaryBitwiseXor
ASTOp.UnaryLogicalNot
ASTOp.UnaryMinus
ASTOp.UnaryPlus
ASTOp.WildcardEquality
ASTOp.WildcardInequality
ASTOpApply
ASTRangeIndex
ASTStmt
ASTTopDecl
ASTTopDeclModule
ASTTopDeclParameter
ASTTopDeclSpec
ASTTopDeclStruct
ASTType
PAST
- pycaliper.frontend.pycgen module
PYCGenPass
PYCGenPass.evaluate_index()
PYCGenPass.generate_module_repr()
PYCGenPass.generate_struct_repr()
PYCGenPass.increment_loop_iterator()
PYCGenPass.pop_loop_scope()
PYCGenPass.push_loop_scope()
PYCGenPass.reset()
PYCGenPass.run()
PYCGenPass.type_to_pyc_repr()
PYCGenPass.visit_ASTBlock()
PYCGenPass.visit_ASTCondEq()
PYCGenPass.visit_ASTEq()
PYCGenPass.visit_ASTForLoop()
PYCGenPass.visit_ASTFunctionCall()
PYCGenPass.visit_ASTIdentifier()
PYCGenPass.visit_ASTInv()
PYCGenPass.visit_ASTModBlock()
PYCGenPass.visit_ASTModEq()
PYCGenPass.visit_ASTModIf()
PYCGenPass.visit_ASTModInput()
PYCGenPass.visit_ASTModInstance()
PYCGenPass.visit_ASTModInv()
PYCGenPass.visit_ASTModOutput()
PYCGenPass.visit_ASTModOutputState()
PYCGenPass.visit_ASTModState()
PYCGenPass.visit_ASTNumber()
PYCGenPass.visit_ASTOpApply()
PYCGenPass.visit_ASTRangeIndex()
TopDeclPass
create_pyc_variable()
- pycaliper.frontend.pyclex module
- pycaliper.frontend.pycparse module
p_ArithmeticShiftLeft()
p_ArithmeticShiftRight()
p_BinaryNand()
p_BinaryNor()
p_BinaryXnor()
p_CaseEquality()
p_CaseInequality()
p_Equality()
p_GreaterThanEqual()
p_Inequality()
p_LessThanEqual()
p_LogicalAnd()
p_LogicalEquivalence()
p_LogicalImplication()
p_LogicalOr()
p_LogicalShiftLeft()
p_LogicalShiftRight()
p_MinusColon()
p_PlusColon()
p_Power()
p_WildcardEquality()
p_WildcardInequality()
p_basetype_1()
p_basetype_2()
p_basetype_3()
p_caliper_declaration_1()
p_caliper_declaration_2()
p_caliper_declaration_3()
p_caliper_declaration_4()
p_caliper_declarations_1()
p_caliper_declarations_2()
p_caliper_loop_1()
p_caliper_loop_list_p_1()
p_caliper_loop_list_p_2()
p_caliper_mod_stmt_1()
p_caliper_mod_stmt_10()
p_caliper_mod_stmt_2()
p_caliper_mod_stmt_3()
p_caliper_mod_stmt_4()
p_caliper_mod_stmt_5()
p_caliper_mod_stmt_6()
p_caliper_mod_stmt_7()
p_caliper_mod_stmt_8()
p_caliper_mod_stmt_9()
p_caliper_mod_stmt_list_1()
p_caliper_mod_stmt_list_2()
p_caliper_statement_1()
p_caliper_statement_2()
p_caliper_statement_3()
p_caliper_statement_4()
p_caliper_statement_5()
p_caliper_statement_6()
p_caliper_statement_list_1()
p_caliper_statement_list_2()
p_caliper_statement_list_p_1()
p_caliper_statement_list_p_2()
p_constant_range()
p_datatype_1()
p_datatype_2()
p_dimension_1()
p_dimension_2()
p_empty()
p_error()
p_expr_list_1()
p_expr_list_2()
p_expr_list_p_1()
p_expr_list_p_2()
p_expression()
p_expression1_1()
p_expression1_2()
p_expression2_1()
p_expression2_2()
p_expression3_1()
p_expression3_2()
p_expression4_1()
p_expression4_2()
p_expression5_1()
p_expression5_2()
p_expression6_1()
p_expression6_2()
p_expression7_1()
p_expression7_2()
p_expression8_1()
p_expression8_2()
p_function_call()
p_identifier()
p_number()
p_primary()
p_primary1_1()
p_primary1_2()
p_primary1_3()
p_primary1_4()
p_primary1_5()
p_primary1_list_p_1()
p_primary1_list_p_2()
- Module contents
- pycaliper.jginterface package
- Submodules
- pycaliper.jginterface.jasperclient module
- pycaliper.jginterface.jgdesign module
- pycaliper.jginterface.jgoracle module
- pycaliper.jginterface.jgsetup module
- Module contents
- pycaliper.per package
- Submodules
- pycaliper.per.expr module
Add
ArithmeticShiftLeft
ArithmeticShiftRight
BinaryAnd
BinaryNor
BinaryOr
BinaryXnor
BinaryXor
CaseEquality
CaseInequality
Concat
Const
Div
Equality
Expr
Extract
GreaterThan
GreaterThanEqual
ITE
Inequality
LessThan
LessThanEqual
LogicalAnd
LogicalEquivalence
LogicalImplication
LogicalOr
LogicalShiftLeft
LogicalShiftRight
Mod
Mul
Op
OpApply
Power
Sub
UnaryBitwiseAnd
UnaryBitwiseNand
UnaryBitwiseNor
UnaryBitwiseNot
UnaryBitwiseOr
UnaryBitwiseXnor
UnaryBitwiseXor
UnaryLogicalNot
UnaryMinus
UnaryPlus
WildcardEquality
WildcardInequality
- pycaliper.per.per module
AuxModule
AuxPort
AuxReg
Clock
CondEq
CondEqHole
Context
CtrAlignHole
Eq
FSMHole
Group
Hole
Inv
Logic
LogicArray
PER
PERHole
Path
Prop
SVFunc
SVFuncApply
SimulationSchedule
SimulationStep
SpecModule
SpecModule.condeqhole()
SpecModule.ctralignhole()
SpecModule.eq()
SpecModule.eqhole()
SpecModule.fsmhole()
SpecModule.full_repr()
SpecModule.get_clk()
SpecModule.get_hier_path()
SpecModule.get_repr()
SpecModule.get_unroll_kind_depths()
SpecModule.incr()
SpecModule.input()
SpecModule.instantiate()
SpecModule.inv()
SpecModule.is_instantiated()
SpecModule.output()
SpecModule.pprint()
SpecModule.prev()
SpecModule.pycassert()
SpecModule.pycassume()
SpecModule.sprint()
SpecModule.stable()
SpecModule.state()
SpecModule.when()
Struct
TypedElem
get_path_from_hierarchical_str()
kinduct()
nonreserved_or_fresh()
unroll()
when()
- Module contents
- pycaliper.synth package
- Submodules
- pycaliper.synth.alignsynthesis module
- pycaliper.synth.btorsynthesizer module
- pycaliper.synth.iis_strategy module
- pycaliper.synth.persynthesis module
- pycaliper.synth.synthprog module
- Module contents
- pycaliper.verif package
Submodules
pycaliper.proofmanager module
- class pycaliper.proofmanager.MMRefinementPR(result, spec1, spec2, rmap)
Bases:
ProofResult
-
rmap:
RefinementMap
-
spec1:
str
-
spec2:
str
-
rmap:
- class pycaliper.proofmanager.OneTraceBndPR(result, spec, sched, design)
Bases:
ProofResult
-
design:
str
-
sched:
str
-
spec:
str
-
design:
- class pycaliper.proofmanager.OneTraceIndPR(result, spec, design, dc)
Bases:
ProofResult
-
dc:
DesignConfig
-
design:
str
-
spec:
str
-
dc:
- class pycaliper.proofmanager.ProofManager(webgui=False, cligui=False)
Bases:
object
- check_mm_refinement(spec1, spec2, rmap)
- check_ss_refinement(spec, sched1, sched2, flip=False)
Check if bounded schedule sched1 refines sched2. If flip is True, then the assertions are flipped in sched1.
- Return type:
- Parameters:
spec (SpecModule | str) – The spec to use.
sched1 (Callable | str) – The first schedule to check.
sched2 (Callable | str) – The second schedule to check.
flip (bool, optional) – Flip the assertions in sched1. Defaults to False.
- mk_btor_design_from_file(file, name)
- Return type:
- mk_btor_proof_one_trace(spec, design, dc=DesignConfig(cpy1='a', cpy2='b', lang='sv12', topmod='', clk='clk'))
- Return type:
- mk_jg_proof_bounded_spec(spec, design, sched)
- Return type:
- mk_spec(spec, name, **kwargs)
- class pycaliper.proofmanager.SSRefinementPR(result, spec, sched1, sched2, flip)
Bases:
ProofResult
-
flip:
bool
-
sched1:
str
-
sched2:
str
-
spec:
str
-
flip:
- class pycaliper.proofmanager.TwoTraceIndPR(result, spec, design, dc)
Bases:
ProofResult
-
dc:
DesignConfig
-
design:
str
-
spec:
str
-
dc:
- pycaliper.proofmanager.mk_btordesign(name, filename)
pycaliper.propns module
Namespace for properties
- pycaliper.propns.TOP_STEP_PROP(fn_name, k)
Get the property name for a given step
- Return type:
str
- pycaliper.propns.condeq_sva(s)
- pycaliper.propns.eq_sva(s)
- pycaliper.propns.get_as_assm(prop)
Get the assumption name for a given property
- Return type:
str
- pycaliper.propns.get_as_prop(prop)
Get the assertion name for a given property
- Return type:
str
pycaliper.pycconfig module
- class pycaliper.pycconfig.Design(name)
Bases:
object
Base class for design representations.
This class serves as a base for different design representations in PyCaliper.
- name
Name of the design.
- Type:
str
- class pycaliper.pycconfig.DesignConfig(**data)
Bases:
BaseModel
Configuration for design verification.
This class holds configuration parameters for design verification.
- cpy1
Hierarchy prefix for the first copy of the design.
- Type:
str
- cpy2
Hierarchy prefix for the second copy of the design.
- Type:
str
- lang
Hardware description language used for the design.
- Type:
str
- topmod
Name of the top module in the design.
- Type:
str
- clk
Name of the clock signal in the design.
- Type:
str
-
clk:
str
-
cpy1:
str
-
cpy2:
str
-
lang:
str
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'clk': FieldInfo(annotation=str, required=False, default='clk'), 'cpy1': FieldInfo(annotation=str, required=False, default='a'), 'cpy2': FieldInfo(annotation=str, required=False, default='b'), 'lang': FieldInfo(annotation=str, required=False, default='sv12'), 'topmod': FieldInfo(annotation=str, required=False, default='')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
-
topmod:
str
- class pycaliper.pycconfig.JasperConfig(**data)
Bases:
BaseModel
Configuration for Jasper Gold formal verification tool.
This class holds configuration parameters for interacting with the Jasper Gold formal verification tool.
- jdir
Jasper working directory relative to the pycaliper directory.
- Type:
str
- script
TCL script relative to the Jasper working directory.
- Type:
str
- pycfile
Location of the generated SVA file relative to the Jasper working directory.
- Type:
str
- context
Proof node context.
- Type:
str
- design_list
Design list file.
- Type:
str
- port
Port number to connect to Jasper server.
- Type:
int
-
context:
str
-
design_list:
str
-
jdir:
str
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'context': FieldInfo(annotation=str, required=False, default=''), 'design_list': FieldInfo(annotation=str, required=False, default='design.lst'), 'jdir': FieldInfo(annotation=str, required=False, default=''), 'port': FieldInfo(annotation=int, required=False, default=8080), 'pycfile': FieldInfo(annotation=str, required=False, default=''), 'script': FieldInfo(annotation=str, required=False, default='')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
-
port:
int
-
pycfile:
str
- pycfile_abspath()
Get the absolute path to the PyCaliper specification file.
- Returns:
Absolute path to the PyCaliper specification file.
- Return type:
str
-
script:
str
- class pycaliper.pycconfig.PYConfig(**data)
Bases:
BaseModel
PyCaliper configuration class.
This class holds the main configuration for PyCaliper tasks.
- sdir
Directory to save results to.
- Type:
str
- mock
Whether to run in mock mode without Jasper access.
- Type:
bool
- jgc
Jasper configuration.
- Type:
- pycspec
Name of the PyCaliper specification.
- Type:
str
- onetrace
Whether to verify only one-trace properties.
- Type:
bool
- tdir
Directory containing VCD trace files.
- Type:
str
- dc
Design configuration.
- Type:
-
dc:
DesignConfig
-
jgc:
JasperConfig
-
mock:
bool
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'dc': FieldInfo(annotation=DesignConfig, required=False, default=DesignConfig(cpy1='a', cpy2='b', lang='sv12', topmod='', clk='clk')), 'jgc': FieldInfo(annotation=JasperConfig, required=False, default=JasperConfig(jdir='', script='', pycfile='', context='', design_list='design.lst', port=8080)), 'mock': FieldInfo(annotation=bool, required=False, default=False), 'onetrace': FieldInfo(annotation=bool, required=False, default=False), 'pycspec': FieldInfo(annotation=str, required=False, default=''), 'sdir': FieldInfo(annotation=str, required=False, default=''), 'tdir': FieldInfo(annotation=str, required=False, default='')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
-
onetrace:
bool
-
pycspec:
str
-
sdir:
str
-
tdir:
str
pycaliper.pycgui module
- class pycaliper.pycgui.GUIPacket(t, iden='', dname='', sname='', file='', params='', proofterm='', result='')
Bases:
object
-
dname:
str
= ''
-
file:
str
= ''
-
iden:
str
= ''
-
params:
str
= ''
-
proofterm:
str
= ''
-
result:
str
= ''
-
sname:
str
= ''
-
dname:
- class pycaliper.pycgui.PYCGUI
Bases:
object
- push_update(data)
- reset_progress()
- run(debug=True)
- update_progress(desc, progress)
pycaliper.pycmain module
- pycaliper.pycmain.main()
Main entry point for the PyCaliper command-line interface.
This function initializes and runs the Typer application that provides the command-line interface for PyCaliper.
- pycaliper.pycmain.persynth_main(specpath='', jgcpath='', dcpath='', params='', sdir='', strategy='seq', fuelbudget=3, retries=1, stepbudget=10)
Synthesize invariants using Partial Equivalence Relations (PER).
This function performs synthesis of invariants for a PyCaliper specification using the PER synthesis approach. It supports different synthesis strategies and configurable parameters for the synthesis process.
- Parameters:
specpath (str) – Path to the PyCaliper specification class.
jgcpath (str) – Path to the Jasper configuration file.
dcpath (str) – Path to the design configuration file.
params (str) – Parameters for the specification module in the format key=value.
sdir (str) – Directory to save synthesis results to.
strategy (str) – Strategy to use for synthesis (‘seq’, ‘rand’, or ‘llm’).
fuelbudget (int) – Fuel budget for the synthesis strategy.
retries (int) – Number of retries for synthesis.
stepbudget (int) – Step budget for synthesis.
- pycaliper.pycmain.svagen_main(specpath='', jgcpath='', dcpath='', params='', sdir='')
Generate SystemVerilog Assertions (SVA) from a PyCaliper specification.
This function generates SVA specifications from a PyCaliper specification class. The generated SVA can be used for formal verification in SystemVerilog environments.
- Parameters:
specpath (str) – Path to the PyCaliper specification class.
jgcpath (str) – Path to the Jasper configuration file.
dcpath (str) – Path to the design configuration file.
params (str) – Parameters for the specification module in the format key=value.
sdir (str) – Directory to save the generated SVA file to.
- pycaliper.pycmain.verif_main(specpath='', jgcpath='', dcpath='', params='', sdir='', onetrace=False, bmc='')
Verify invariants in a PyCaliper specification.
This function performs formal verification of the properties specified in a PyCaliper specification class. It can perform either one-trace or two-trace verification, and supports bounded model checking.
- Parameters:
specpath (str) – Path to the PyCaliper specification class.
jgcpath (str) – Path to the Jasper configuration file.
dcpath (str) – Path to the design configuration file.
params (str) – Parameters for the specification module in the format key=value.
sdir (str) – Directory to save verification results to.
onetrace (bool) – If True, verify only one-trace properties.
bmc (str) – If provided, perform verification with bounded model checking.
pycaliper.pycmanager module
- class pycaliper.pycmanager.PYCArgs(**data)
Bases:
BaseModel
Arguments for PyCaliper tasks.
This class defines the arguments that can be passed to PyCaliper tasks. It uses Pydantic for validation and default values.
- specpath
Path to the specification module.
- Type:
str
- jgcpath
Path to the Jasper configuration file.
- Type:
str
- dcpath
Path to the design configuration file.
- Type:
str
- params
Parameters for the specification module.
- Type:
str
- sdir
Directory to save results to.
- Type:
str
- tdir
Directory containing trace files.
- Type:
str
- onetrace
Whether to verify only one-trace properties.
- Type:
bool
- bmc
Bounded model checking configuration.
- Type:
str
-
bmc:
str
Bounded model checking configuration
-
dcpath:
str
Path to the design configuration file
-
jgcpath:
str
Path to the Jasper configuration file
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'bmc': FieldInfo(annotation=str, required=False, default=''), 'dcpath': FieldInfo(annotation=str, required=False, default=''), 'jgcpath': FieldInfo(annotation=str, required=False, default=''), 'onetrace': FieldInfo(annotation=bool, required=False, default=False), 'params': FieldInfo(annotation=str, required=False, default=''), 'sdir': FieldInfo(annotation=str, required=False, default=''), 'specpath': FieldInfo(annotation=str, required=False, default=''), 'tdir': FieldInfo(annotation=str, required=False, default='')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
-
onetrace:
bool
Whether to verify only one-trace properties
-
params:
str
Parameters for the specification module
-
sdir:
str
Directory to save results to
-
specpath:
str
Path to the specification module
-
tdir:
str
Directory containing trace files
- class pycaliper.pycmanager.PYCManager(pyconfig)
Bases:
object
Manager for PyCaliper tasks.
This class manages the execution of PyCaliper tasks, including handling of temporary directories, trace files, and specification files.
- pycspec
Name of the PyCaliper specification.
- Type:
str
- sdir
Directory to save results to.
- Type:
str
- wdir
Working directory for the task.
- Type:
str
- tracedir
Directory for trace files.
- Type:
str
- specdir
Directory for specification files.
- Type:
str
- num_vcd_files
Number of VCD trace files.
- Type:
int
- traces
Dictionary of trace file paths.
- Type:
dict
- num_spec_files
Number of specification files.
- Type:
int
- specs
Dictionary of specification file paths.
- Type:
dict
- close()
Close the PyCaliper manager.
This function saves the results and closes the Jasper socket.
- create_vcd_path()
Create a new path for a VCD trace file.
- Returns:
Path to the new VCD trace file.
- Return type:
str
- gather_all_traces(tdir)
Gather all VCD trace files from a directory.
This function collects all VCD files in the specified directory and copies them to the trace directory.
- Parameters:
tdir (str) – Directory containing VCD trace files.
- get_vcd_path(idx)
Get the path to a VCD trace file by index.
- Parameters:
idx (int) – Index of the VCD trace file.
- Returns:
Path to the VCD trace file.
- Return type:
str
- get_vcd_path_random()
Get the path to a random VCD trace file.
- Returns:
Path to a random VCD trace file, or None if no trace files are available.
- Return type:
str
- save()
Save the results of the PyCaliper task.
This function copies the contents of the working directory to the specified save directory.
- save_spec(module)
Save a specification module to a file.
- Parameters:
module (SpecModule) – Specification module to save.
- class pycaliper.pycmanager.PYCTask(value)
Bases:
Enum
Enumeration of PyCaliper tasks.
Defines the different types of tasks that can be performed by PyCaliper.
- CTRLSYNTH = 4
Control synthesis
- FULLSYNTH = 6
Full synthesis
- PERSYNTH = 5
PER synthesis
- SVAGEN = 0
Generate SVA specifications
- VERIF1T = 1
One-trace verification
- VERIF2T = 2
Two-trace verification
- VERIFBMC = 3
Bounded model checking verification
- pycaliper.pycmanager.create_module(specpath, args)
Dynamically import the spec module and create an instance of it.
- pycaliper.pycmanager.get_pyconfig(args)
Create a PyCaliper configuration from arguments.
This function creates a PyCaliper configuration from the provided arguments, including loading and validating Jasper and design configurations.
- pycaliper.pycmanager.get_specmodname(specmod)
Extract the specification module name from a path.
- Parameters:
specmod (str) – Path to the specification module.
- Returns:
Name of the specification module.
- Return type:
str
- pycaliper.pycmanager.mock_or_connect(pyconfig)
Connect to Jasper or run in mock mode.
- Return type:
bool
- Parameters:
pyconfig (PYConfig) – PyCaliper configuration.
- Returns:
True if connected to Jasper, False if running in mock mode.
- Return type:
bool
- pycaliper.pycmanager.setup_all(args)
Set up all components for a PyCaliper task.
This function creates a PyCaliper configuration, manager, and connects to Jasper.
- Return type:
tuple
[bool
,PYConfig
,PYCManager
]- Parameters:
args (PYCArgs) – PyCaliper arguments.
- Returns:
Tuple of (is_connected, pyconfig, tmgr).
- Return type:
tuple
- pycaliper.pycmanager.start(task, args)
Start a PyCaliper task.
This function sets up all components for a PyCaliper task and checks that the task can be run in the current mode.
- Return type:
tuple
[PYConfig
,PYCManager
,SpecModule
]- Parameters:
- Returns:
Tuple of (pyconfig, tmgr, module).
- Return type:
tuple
pycaliper.svagen module
Generate SVA (wires, assumes, asserts) for specifications in PER
- class pycaliper.svagen.ModuleSpec(**data)
Bases:
BaseModel
-
input_inv_spec_decl_comp:
str
-
input_inv_spec_decl_single:
str
-
input_spec_decl:
str
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'input_inv_spec_decl_comp': FieldInfo(annotation=str, required=True), 'input_inv_spec_decl_single': FieldInfo(annotation=str, required=True), 'input_spec_decl': FieldInfo(annotation=str, required=True), 'output_inv_spec_decl_comp': FieldInfo(annotation=str, required=True), 'output_inv_spec_decl_single': FieldInfo(annotation=str, required=True), 'output_spec_decl': FieldInfo(annotation=str, required=True), 'path': FieldInfo(annotation=Path, required=True), 'state_inv_spec_decl_comp': FieldInfo(annotation=str, required=True), 'state_inv_spec_decl_single': FieldInfo(annotation=str, required=True), 'state_spec_decl': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
-
output_inv_spec_decl_comp:
str
-
output_inv_spec_decl_single:
str
-
output_spec_decl:
str
-
state_inv_spec_decl_comp:
str
-
state_inv_spec_decl_single:
str
-
state_spec_decl:
str
-
input_inv_spec_decl_comp:
- class pycaliper.svagen.SVAContext(**data)
Bases:
BaseModel
-
asrts_1trace:
list
[str
]
-
asrts_2trace:
list
[str
]
-
asrts_bmc:
dict
[str
,list
[str
]]
-
assms_1trace:
list
[str
]
-
assms_2trace:
list
[str
]
-
assms_bmc:
dict
[str
,list
[str
]]
-
holes:
list
[str
]
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'asrts_1trace': FieldInfo(annotation=list[str], required=False, default=[]), 'asrts_2trace': FieldInfo(annotation=list[str], required=False, default=[]), 'asrts_bmc': FieldInfo(annotation=dict[str, list[str]], required=False, default={}), 'assms_1trace': FieldInfo(annotation=list[str], required=False, default=[]), 'assms_2trace': FieldInfo(annotation=list[str], required=False, default=[]), 'assms_bmc': FieldInfo(annotation=dict[str, list[str]], required=False, default={}), 'holes': FieldInfo(annotation=list[str], required=False, default=[])}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
-
asrts_1trace:
- class pycaliper.svagen.SVAGen
Bases:
object
- counter_step(kd, td)
Generate counter and step signals for the simulation.
- Parameters:
kd (int) – Number of steps for inductions (generate induction trigger)
td (int) – Number of steps across all simulations schedules + induction
- create_pyc_specfile(topmod, dc, filename='temp.pyc.sv', onetrace=False)
- pycaliper.svagen.inv_sva(mod, spec_ctx)
- pycaliper.svagen.per_sva(mod, spec_ctx)
- pycaliper.svagen.step_signal(k)
pycaliper.vcdutils module
PyCaliper
Author: Adwait Godbole, UC Berkeley
File: vcdutils.py
Utilities to read VCD files
- class pycaliper.vcdutils.Assignment(*args, **kwargs)
Bases:
MutableMapping
Assignment map from signals and values in the simulation
- pycaliper.vcdutils.autodetect_clock(vcdr)
Find the clock signal in the VCD file
- Return type:
str
- Parameters:
vcdr (VCDVCD) – VCDVCD object read from vcd file
- Returns:
clock signal name
- Return type:
str
- pycaliper.vcdutils.autodetect_clockdelta(vcdr, clk)
Find the clock signal delta in the VCD file
- Return type:
int
- Parameters:
vcdr (VCDVCD) – VCDVCD object read from vcd file
- Returns:
clock timedelta
- Return type:
int
- pycaliper.vcdutils.get_subtrace(vcdr, sigs, rng, clk, ctx='')
- Return type:
list
[Assignment
]
- Extract the signals from the vcd trace between the start_cyc and end_cyc (both inclusive)
This is done only for signals that have counterparts in the design (CSIGs and DSIGs)
- Parameters:
vcdr (VCDVCD) – VCDVCD object read from vcd file
sigs (list[Logic]) – list of Logic signals
rng (range) – range denoting the time steps to be sampled at
ctx (str, optional) – context string (path to top module). Defaults to ‘’.
- Returns:
a list of Assignment objects, one for each step in rng
- Return type:
list[Assignment]
- pycaliper.vcdutils.get_subtrace_simple(vcdr, sigs, rng)
Extract signal values from the VCD trace directly from the signal names.
- Parameters:
vcdr (VCDVCD) – VCDVCD object read from vcd file
sigs (List[str]) – list of signal names to read from the vcd file
rng (range) – range denoting the time steps to be sampled at
- Returns:
- a list of dictionaries,
representing the memory values at each point
- Return type:
List[Dict[str, Union[int, str]]]
- pycaliper.vcdutils.signalstr_to_vcdid(sig)
Convert a signal string to a VCD string
- Parameters:
sig (str) – signal string
- Returns:
VCD string
- Return type:
str