Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
progkrets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Solveig Langbakk
progkrets
Commits
02b1355d
Commit
02b1355d
authored
6 months ago
by
Nils
Browse files
Options
Downloads
Patches
Plain Diff
Lagt til en test for busy og fikset så baud teller fra når den bytter fra idle
parent
c2a99f6f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tx.vhd
+5
-0
5 additions, 0 deletions
Tx.vhd
Tx_tb.vhd
+15
-3
15 additions, 3 deletions
Tx_tb.vhd
with
20 additions
and
3 deletions
Tx.vhd
+
5
−
0
View file @
02b1355d
...
...
@@ -183,6 +183,7 @@ begin
baud_count
<=
0
;
baud_clk
<=
'0'
;
elsif
rising_edge
(
clk
)
then
if
tx_state
/=
IDLE
then
if
baud_count
=
division_factor
(
baud_rate
)
-
1
then
baud_clk
<=
'1'
;
baud_count
<=
0
;
...
...
@@ -190,6 +191,10 @@ begin
baud_clk
<=
'0'
;
baud_count
<=
baud_count
+
1
;
end
if
;
else
baud_clk
<=
'0'
;
baud_count
<=
0
;
-- Nullstill teller i andre tilstander
end
if
;
end
if
;
end
process
;
end
Behavioral
;
This diff is collapsed.
Click to expand it.
Tx_tb.vhd
+
15
−
3
View file @
02b1355d
...
...
@@ -87,7 +87,7 @@ begin
begin
Wr_sig
<=
'1'
;
adresse
<=
"000"
;
-- Konfigurer baud rate og paritet
Data_bus
<=
"000
11
001"
;
-- Sett baud rate til 57600 (001) og
ulik
paritet (
11
)
Data_bus
<=
"000
00
001"
;
-- Sett baud rate til 57600 (001) og
ingen
paritet (
00
)
wait
for
CLK_PERIOD
;
Wr_sig
<=
'0'
;
wait
for
CLK_PERIOD
;
...
...
@@ -97,17 +97,29 @@ begin
begin
Wr_sig
<=
'1'
;
adresse
<=
"001"
;
-- Sender data til Tx
Data_bus
<=
"1
1111
101"
;
-- data
Data_bus
<=
"1
010
101
0
"
;
-- data
wait
for
CLK_PERIOD
;
Wr_sig
<=
'0'
;
wait
for
20
*
CLK_PERIOD
;
wait
for
0
.
25
ms
;
wait
for
0
.
18
ms
;
end
send
;
procedure
test_busy
is
begin
Rd_sig
<=
'1'
;
adresse
<=
"010"
;
-- Konfigurer Ber om status
wait
for
2
*
CLK_PERIOD
;
Rd_sig
<=
'0'
;
wait
for
CLK_PERIOD
;
wait
for
0
.
1
ms
;
end
test_busy
;
begin
tb_init
;
config
;
send
;
test_busy
;
wait
for
100
ns
;
assert
false
report
"Testbench finished"
severity
failure
;
...
...
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