Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simuDAtor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
simuDAtor
Commits
0da8baff
Commit
0da8baff
authored
9 months ago
by
Martin Högstedt
Browse files
Options
Downloads
Patches
Plain Diff
Apply 3 suggestion(s) to 3 file(s)
parent
32f0df4b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!40
started to seperate state and parameters, ended up doing more work on keeping private variables private
Pipeline
#133243
failed
9 months ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/simudator/core/module.py
+1
-1
1 addition, 1 deletion
src/simudator/core/module.py
src/simudator/core/modules/mux.py
+3
-3
3 additions, 3 deletions
src/simudator/core/modules/mux.py
src/simudator/core/modules/register.py
+1
-1
1 addition, 1 deletion
src/simudator/core/modules/register.py
with
5 additions
and
5 deletions
src/simudator/core/module.py
+
1
−
1
View file @
0da8baff
...
@@ -87,7 +87,7 @@ class Module:
...
@@ -87,7 +87,7 @@ class Module:
Returns
Returns
-------
-------
dict[str, Any]
dict[str, Any]
Parameter of the module represented as a dictionary with one key for
Parameter
s
of the module represented as a dictionary with one key for
each parameter variable.
each parameter variable.
"""
"""
param_dict
=
dict
()
param_dict
=
dict
()
...
...
This diff is collapsed.
Click to expand it.
src/simudator/core/modules/mux.py
+
3
−
3
View file @
0da8baff
...
@@ -87,10 +87,10 @@ class Mux(Module):
...
@@ -87,10 +87,10 @@ class Mux(Module):
return
state
return
state
def
get_parameter
(
self
)
->
dict
[
str
,
Any
]:
def
get_parameter
(
self
)
->
dict
[
str
,
Any
]:
paramter
=
super
().
get_state
()
param
e
ter
=
super
().
get_state
()
paramter
[
"
bit_length
"
]
=
self
.
_bit_length
param
e
ter
[
"
bit_length
"
]
=
self
.
_bit_length
return
paramter
return
param
e
ter
def
save_state_to_file
(
self
,
file_path
:
str
)
->
bool
:
def
save_state_to_file
(
self
,
file_path
:
str
)
->
bool
:
content
=
self
.
name
+
"
:
\n
value:
"
+
str
(
self
.
_value
)
+
"
\n\n
"
content
=
self
.
name
+
"
:
\n
value:
"
+
str
(
self
.
_value
)
+
"
\n\n
"
...
...
This diff is collapsed.
Click to expand it.
src/simudator/core/modules/register.py
+
1
−
1
View file @
0da8baff
...
@@ -115,7 +115,7 @@ class IntegerRegister(Register):
...
@@ -115,7 +115,7 @@ class IntegerRegister(Register):
name
:
str
|
None
=
None
,
name
:
str
|
None
=
None
,
)
->
None
:
)
->
None
:
# set the register
s
name
# set the register name
if
name
is
None
:
if
name
is
None
:
name
=
f
"
{
bit_length
}
-bit register
"
name
=
f
"
{
bit_length
}
-bit register
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment