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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Solveig Langbakk
progkrets
Commits
3a95b0cd
Commit
3a95b0cd
authored
7 months ago
by
Solveig Langbakk
Browse files
Options
Downloads
Patches
Plain Diff
ferskeste endringene
parent
58cb7267
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
controller.vhd
+16
-16
16 additions, 16 deletions
controller.vhd
controller_tb.vhd
+3
-3
3 additions, 3 deletions
controller_tb.vhd
with
19 additions
and
19 deletions
controller.vhd
+
16
−
16
View file @
3a95b0cd
...
...
@@ -28,7 +28,7 @@ architecture RTL of Controller is
signal
internal_z
:
std_logic_vector
(
2
downto
0
);
signal
txBusy
:
std_logic
;
function
resetLogic
(
count
:
integer
)
return
integer
is
procedure
resetLogic
(
inten
:
integer
)
is
begin
case
Baud_rate_sel
is
when
"000"
=>
internal_baud
(
2
downto
0
)
<=
"000"
;
...
...
@@ -48,33 +48,33 @@ architecture RTL of Controller is
end
case
;
end
function
resetLogic
;
end
procedure
resetLogic
;
function
statusCheck
(
turn
T
aker
:
std_logic
)
return
std_logic
is
impure
function
statusCheck
(
turn
t
aker
:
std_logic
)
return
std_logic
is
begin
if
turnTaker
=
'0'
then
-- til TX
Rd_sig
<=
"1"
;
Rd_sig
<=
'1'
;
adresse
<=
"010"
;
turn
T
aker
<=
'1'
;
return
1
;
turn
t
aker
<=
'1'
;
return
'1'
;
else
-- Til RX
Rd_sig
<=
"1"
;
Rd_sig
<=
'1'
;
adresse
<=
"110"
;
turn
T
aker
<=
'0'
;
return
0
;
turn
t
aker
<=
'0'
;
return
'0'
;
end
if
;
end
function
statusCheck
;
function
getStatusFromRx
(
databus
:
std_logic_vector
(
7
downto
0
))
return
std_logic
is
impure
function
getStatusFromRx
(
databus
:
std_logic_vector
(
7
downto
0
))
return
std_logic
is
begin
Rd_sig
<=
'1'
;
adress
<=
"101"
;
adress
e
<=
"101"
;
end
function
getStatusFromRx
;
function
sendDataToTx
(
databus
:
std_logic_vector
(
7
downto
0
))
return
std_logic
is
impure
function
sendDataToTx
(
databus
:
std_logic_vector
(
7
downto
0
))
return
std_logic
is
begin
if
txBusy
=
'0'
then
adress
<=
"001"
;
adress
e
<=
"001"
;
Data_bus
<=
databus
;
Wr_sig
<=
'1'
;
else
...
...
@@ -95,7 +95,7 @@ begin
-- Reset er starten av oppdraget. Her sendes config-informasjon.
if
rst_n
=
'0'
then
resetLogic
(
count
)
;
resetLogic
;
internal_z
(
2
downto
0
)
<=
"000"
;
count
:
=
1
;
...
...
@@ -107,7 +107,7 @@ begin
internal_z
(
2
downto
0
)
<=
"000"
;
Data_bus
(
7
downto
0
)
<=
internal_z
&
internal_parity
&
internal_baud
;
adresse
<=
"000"
;
Wr_sig
<=
"1"
;
Wr_sig
<=
'1'
;
count
:
=
count
+
1
;
elsif
count
=
"2"
then
internal_z
(
2
downto
0
)
<=
"110"
;
...
...
@@ -121,7 +121,7 @@ begin
Data_bus
<=
"ZZZZZZZZ"
;
end
if
;
statusChecker
(
turnTaker
);
turnTaker
<=
statusChecker
(
turnTaker
);
if
Data_bus
=
"ZZZZZZZZ"
then
Rd_sig
<=
'0'
;
else
if
Rd_sig
=
'1'
then
...
...
This diff is collapsed.
Click to expand it.
controller_tb.vhd
+
3
−
3
View file @
3a95b0cd
...
...
@@ -21,7 +21,7 @@ architecture SimulationModel of controller_tb is
LED_msg
:
out
std_logic
;
Data_bus
:
inout
std_logic_vector
(
7
downto
0
);
parity_sel
:
in
std_logic_vector
(
1
downto
0
);
adresse
:
in
out
std_logic_vector
(
2
downto
0
);
adresse
:
out
std_logic_vector
(
2
downto
0
);
Rd_sig
,
Wr_sig
:
out
std_logic
);
end
component
;
...
...
@@ -96,7 +96,7 @@ begin
begin
msg_key
<=
'1'
;
wait
for
CLK_PERIOD
;
wait
for
CLK_PERIOD
;
--
wait for CLK_PERIOD;
msg_key
<=
'0'
;
wait
for
CLK_PERIOD
;
end
pressButton
;
...
...
@@ -105,7 +105,7 @@ begin
procedure
loopAscii
is
begin
wait
for
100
ns
;
adresse
(
2
downto
0
)
<=
"101"
;
adresse
<=
"101"
;
--wait until rising_edge(clk);
Data_bus
<=
"01000001"
;
--wait until rising_edge(clk);
...
...
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