qhdl Package¶
qhdl
Package¶
qhdl
Module¶
This module contains the code to convert a circuit specified in QHDL into a Gough-James circuit expression.
The other module in this package qhdl_parser
implements an actual parser for the qhdl source text, while this file then
converts structured netlist information into a circuit expression.
For more details on the QHDL syntax, see The QHDL Syntax.
-
class
qnet.qhdl.qhdl.
Architecture
(identifier, entity, components, signals, assignments, global_assignments={})[source]¶ Bases:
qnet.qhdl.qhdl.QHDLObject
-
global_in
= {}¶
-
global_inout
= {}¶
-
global_out
= {}¶
-
in_to_signal
= {}¶
-
inout_to_signal
= {}¶
-
lossy_signals
= []¶
-
out_to_signal
= {}¶
-
signal_to_global_in
= {}¶
-
signal_to_global_out
= {}¶
-
signals
= []¶
-
-
class
qnet.qhdl.qhdl.
BasicInterface
(identifier, generics, ports)[source]¶ Bases:
qnet.qhdl.qhdl.QHDLObject
-
cid
= 0¶
-
generic_identifiers
¶ The generic_identifiers property.
-
gids
¶ The generic_identifiers property.
-
in_port_identifiers
= []¶
-
inout_port_identifiers
= []¶
-
out_port_identifiers
= []¶
-
port_identifiers
¶ The port_identifiers property.
-
qhdl_parser
Module¶
The PLY-based QHDLParser class.
-
class
qnet.qhdl.qhdl_parser.
QHDLParser
(**kw)[source]¶ Bases:
qnet.misc.parser.Parser
-
p_architecture_declaration
(p)[source]¶ architecture_declaration : ARCHITECTURE ID OF ID IS architecture_head BEGIN instance_mapping_assignment_list feedleft_assignment_list END opt_arch opt_id SEMI
-
p_component_declaration
(p)[source]¶ component_declaration : COMPONENT ID generic_clause port_clause END COMPONENT opt_id SEMI
-
p_component_declaration_list
(p)[source]¶ - component_declaration_list : component_declaration_list component_declaration
- component_declaration
-
p_entity_declaration
(p)[source]¶ entity_declaration : ENTITY ID IS generic_clause port_clause END opt_entity opt_id SEMI
-
p_feedleft_assignment_list
(p)[source]¶ - feedleft_assignment_list : feedleft_assignment_list feedleft_assignment
- feedleft_assignment
-
p_feedright_generic_assignment
(p)[source]¶ - feedright_generic_assignment : ID FEEDRIGHT id_or_value
- id_or_value
-
p_feedright_generic_assignment_list
(p)[source]¶ - feedright_generic_assignment_list : feedright_generic_assignment_list COMMA feedright_generic_assignment
- feedright_generic_assignment
-
p_feedright_port_assignment_list
(p)[source]¶ - feedright_port_assignment_list : feedright_port_assignment_list COMMA feedright_port_assignment
- feedright_port_assignment
-
p_generic_map
(p)[source]¶ - generic_map : GENERIC MAP LPAREN feedright_generic_assignment_list RPAREN SEMI
- empty
-
p_generic_statement
(p)[source]¶ generic_statement : GENERIC LPAREN generic_list opt_semi RPAREN SEMI
-
p_instance_mapping_assignment
(p)[source]¶ instance_mapping_assignment : ID COLON ID generic_map port_map
-
p_instance_mapping_assignment_list
(p)[source]¶ - instance_mapping_assignment_list : instance_mapping_assignment_list instance_mapping_assignment
- instance_mapping_assignment
-
p_non_io_port_entry_group
(p)[source]¶ non_io_port_entry_group : id_list COLON signal_direction signal_type
-
p_non_io_port_list
(p)[source]¶ - non_io_port_list : non_io_port_entry_group SEMI non_io_port_list
- non_io_port_entry_group
-
p_with_io_port_list
(p)[source]¶ - with_io_port_list : io_port_entry_group SEMI non_io_port_list
- io_port_entry_group
-
reserved
= {'architecture': 'ARCHITECTURE', 'begin': 'BEGIN', 'complex': 'COMPLEX', 'component': 'COMPONENT', 'end': 'END', 'entity': 'ENTITY', 'fieldmode': 'FIELDMODE', 'generic': 'GENERIC', 'in': 'IN', 'inout': 'INOUT', 'int': 'INT', 'is': 'IS', 'lossy_fieldmode': 'LOSSY_FIELDMODE', 'map': 'MAP', 'of': 'OF', 'out': 'OUT', 'port': 'PORT', 'real': 'REAL', 'signal': 'SIGNAL'}¶
-
start
= 'top_level_list'¶
-
t_ASSIGN
= ':='¶
-
t_COLON
= ':'¶
-
t_COMMA
= ','¶
-
t_FCONST
= '-?((\\d+)(\\.\\d+)(e(\\+|-)?(\\d+))? | (\\d+)e(\\+|-)?(\\d+))'¶
-
t_FEEDLEFT
= '<='¶
-
t_FEEDRIGHT
= '=>'¶
-
t_ICONST
= '-?\\d+'¶
-
t_LPAREN
= '\\('¶
-
t_RPAREN
= '\\)'¶
-
t_SEMI
= ';'¶
-
t_ignore
= ' \t\x0c'¶
-
tokens
= ['MAP', 'GENERIC', 'COMPONENT', 'PORT', 'IN', 'ENTITY', 'SIGNAL', 'OUT', 'COMPLEX', 'REAL', 'END', 'BEGIN', 'IS', 'OF', 'INOUT', 'LOSSY_FIELDMODE', 'INT', 'ARCHITECTURE', 'FIELDMODE', 'ID', 'ICONST', 'FCONST', 'ASSIGN', 'FEEDRIGHT', 'FEEDLEFT', 'LPAREN', 'RPAREN', 'COMMA', 'SEMI', 'COLON']¶
-