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
386d4d6c
Commit
386d4d6c
authored
10 months ago
by
Johannes Kung
Browse files
Options
Downloads
Patches
Plain Diff
Fixed broken tests due to renambed processor attributes
parent
ab5674b3
No related branches found
No related tags found
1 merge request
!39
Moved printing functionality out from Processor class + minor refactor of...
Pipeline
#133084
failed
10 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test_core/test_breakpoint.py
+14
-14
14 additions, 14 deletions
test/test_core/test_breakpoint.py
test/test_core/test_reset.py
+12
-12
12 additions, 12 deletions
test/test_core/test_reset.py
with
26 additions
and
26 deletions
test/test_core/test_breakpoint.py
+
14
−
14
View file @
386d4d6c
...
@@ -201,14 +201,14 @@ def test_add_remove_memory_breakpoint():
...
@@ -201,14 +201,14 @@ def test_add_remove_memory_breakpoint():
mem
=
Memory
(
in_s
,
out_s
,
ctrl_s
,
adr_s
,
8
)
mem
=
Memory
(
in_s
,
out_s
,
ctrl_s
,
adr_s
,
8
)
cpu
.
add_module
(
mem
)
cpu
.
add_module
(
mem
)
assert
len
(
cpu
.
breakpoints
)
==
0
assert
len
(
cpu
.
_
breakpoints
)
==
0
assert
cpu
.
breakpoint_id_counter
==
1
assert
cpu
.
_
breakpoint_id_counter
==
1
cpu
.
add_memory_breakpoint
(
"
Memory
"
,
1
,
1
)
cpu
.
add_memory_breakpoint
(
"
Memory
"
,
1
,
1
)
assert
cpu
.
breakpoint_id_counter
==
2
assert
cpu
.
_
breakpoint_id_counter
==
2
assert
len
(
cpu
.
breakpoints
)
==
1
assert
len
(
cpu
.
_
breakpoints
)
==
1
assert
cpu
.
remove_breakpoint
(
1
)
==
True
assert
cpu
.
remove_breakpoint
(
1
)
==
True
assert
cpu
.
breakpoints
==
{}
assert
cpu
.
_
breakpoints
==
{}
assert
len
(
cpu
.
breakpoints
)
==
0
assert
len
(
cpu
.
_
breakpoints
)
==
0
def
test_stop_on_memory_breakpoint
():
def
test_stop_on_memory_breakpoint
():
...
@@ -223,7 +223,7 @@ def test_stop_on_memory_breakpoint():
...
@@ -223,7 +223,7 @@ def test_stop_on_memory_breakpoint():
mem
=
Memory
(
in_s
,
out_s
,
ctrl_s
,
adr_s
,
8
)
mem
=
Memory
(
in_s
,
out_s
,
ctrl_s
,
adr_s
,
8
)
cpu
.
add_module
(
mem
)
cpu
.
add_module
(
mem
)
assert
mem
.
_memory
==
[
0
for
_
in
range
(
8
)]
assert
mem
.
_memory
==
[
0
for
_
in
range
(
8
)]
assert
cpu
.
clock
==
0
assert
cpu
.
_
clock
==
0
in_s
.
update_value
(
1
)
in_s
.
update_value
(
1
)
ctrl_s
.
update_value
(
True
)
ctrl_s
.
update_value
(
True
)
...
@@ -235,7 +235,7 @@ def test_stop_on_memory_breakpoint():
...
@@ -235,7 +235,7 @@ def test_stop_on_memory_breakpoint():
cpu
.
run_continuously
()
cpu
.
run_continuously
()
assert
mem
.
_memory
==
[
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
]
assert
mem
.
_memory
==
[
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
]
assert
cpu
.
is_stopped
==
True
assert
cpu
.
is_stopped
==
True
assert
cpu
.
clock
==
2
assert
cpu
.
_
clock
==
2
mem
.
_memory
=
[
0
for
_
in
range
(
8
)]
mem
.
_memory
=
[
0
for
_
in
range
(
8
)]
in_s
.
update_value
(
1
)
in_s
.
update_value
(
1
)
...
@@ -257,14 +257,14 @@ def test_add_remove_state_breakpoint():
...
@@ -257,14 +257,14 @@ def test_add_remove_state_breakpoint():
lc
=
LC
(
s
,
s
,
s
,
s
)
lc
=
LC
(
s
,
s
,
s
,
s
)
cpu
.
add_module
(
lc
)
cpu
.
add_module
(
lc
)
assert
len
(
cpu
.
breakpoints
)
==
0
assert
len
(
cpu
.
_
breakpoints
)
==
0
assert
cpu
.
breakpoint_id_counter
==
1
assert
cpu
.
_
breakpoint_id_counter
==
1
cpu
.
add_state_breakpoint
(
"
LC
"
,
"
value
"
,
1
)
cpu
.
add_state_breakpoint
(
"
LC
"
,
"
value
"
,
1
)
assert
len
(
cpu
.
breakpoints
)
==
1
assert
len
(
cpu
.
_
breakpoints
)
==
1
assert
cpu
.
breakpoint_id_counter
==
2
assert
cpu
.
_
breakpoint_id_counter
==
2
assert
cpu
.
remove_breakpoint
(
1
)
==
True
assert
cpu
.
remove_breakpoint
(
1
)
==
True
assert
cpu
.
breakpoints
==
{}
assert
cpu
.
_
breakpoints
==
{}
assert
len
(
cpu
.
breakpoints
)
==
0
assert
len
(
cpu
.
_
breakpoints
)
==
0
def
test_stop_on_state_breakpoint
():
def
test_stop_on_state_breakpoint
():
...
...
This diff is collapsed.
Click to expand it.
test/test_core/test_reset.py
+
12
−
12
View file @
386d4d6c
...
@@ -35,22 +35,22 @@ class DummyModule(Module):
...
@@ -35,22 +35,22 @@ class DummyModule(Module):
def
test_reset
():
def
test_reset
():
cpu
=
Processor
()
cpu
=
Processor
()
cpu
.
signal_history
=
[
"
this
"
,
"
should
"
,
"
be
"
,
"
removed
"
]
cpu
.
_
signal_history
=
[
"
this
"
,
"
should
"
,
"
be
"
,
"
removed
"
]
dummy
=
DummyModule
()
dummy
=
DummyModule
()
cpu
.
clock
=
100
cpu
.
_
clock
=
100
cpu
.
removed_cycles
=
1337
cpu
.
_
removed_cycles
=
1337
cpu
.
module_history
.
append
(
dummy
.
get_state
())
cpu
.
_
module_history
.
append
(
dummy
.
get_state
())
cpu
.
signal_history
.
clear
()
cpu
.
_
signal_history
.
clear
()
cpu
.
removed_cycles
=
0
cpu
.
_
removed_cycles
=
0
cpu
.
assembly_cycles
=
[
i
for
i
in
range
(
9
)]
cpu
.
_
assembly_cycles
=
[
i
for
i
in
range
(
9
)]
cpu
.
add_module
(
dummy
)
cpu
.
add_module
(
dummy
)
cpu
.
reset
()
cpu
.
reset
()
assert
dummy
.
name
==
"
dummy
"
assert
dummy
.
name
==
"
dummy
"
assert
dummy
.
a
==
0
assert
dummy
.
a
==
0
assert
dummy
.
b
==
""
assert
dummy
.
b
==
""
assert
dummy
.
c
==
[]
assert
dummy
.
c
==
[]
assert
cpu
.
clock
==
0
assert
cpu
.
_
clock
==
0
assert
cpu
.
removed_cycles
==
0
assert
cpu
.
_
removed_cycles
==
0
assert
cpu
.
module_history
==
[]
assert
cpu
.
_
module_history
==
[]
assert
cpu
.
signal_history
==
[]
assert
cpu
.
_
signal_history
==
[]
assert
cpu
.
assembly_cycles
==
[
0
]
assert
cpu
.
_
assembly_cycles
==
[
0
]
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