Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
KnightMCU
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
David Lanzendörfer
KnightMCU
Commits
56acd3b0
Commit
56acd3b0
authored
1 year ago
by
David Lanzendörfer
Browse files
Options
Downloads
Patches
Plain Diff
Remove concurring edges?
parent
cd20c3b7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
verilog/src/chatgpt/Matrix_Convolution.v
+9
-19
9 additions, 19 deletions
verilog/src/chatgpt/Matrix_Convolution.v
verilog/src/chatgpt/Matrix_Multiplication.v
+9
-19
9 additions, 19 deletions
verilog/src/chatgpt/Matrix_Multiplication.v
with
18 additions
and
38 deletions
verilog/src/chatgpt/Matrix_Convolution.v
+
9
−
19
View file @
56acd3b0
...
...
@@ -74,21 +74,6 @@ module Matrix_Convolution (
so we've got to implement this for loop as a state machine instead.
*/
reg
last_enable
;
reg
enable_edge
;
always
@
(
posedge
clk
)
begin
if
(
reset
)
begin
enable_edge
<=
0
;
last_enable
<=
0
;
end
else
if
(
!
last_enable
&&
enable
)
begin
enable_edge
<=
1
;
last_enable
<=
0
;
end
else
begin
last_enable
<=
enable
;
end
end
always
@
(
posedge
clk
)
begin
// Assign initial values
if
(
reset
)
begin
...
...
@@ -109,7 +94,7 @@ module Matrix_Convolution (
result_buffer
<=
0
;
operator1_buffer
<=
0
;
operator2_buffer
<=
0
;
enabl
e_edg
e
<=
0
;
last_
enable
<=
0
;
end
// State machine
else
begin
...
...
@@ -136,7 +121,7 @@ module Matrix_Convolution (
result_buffer
<=
0
;
operator1_buffer
<=
0
;
operator2_buffer
<=
0
;
enabl
e_edg
e
<=
0
;
last_
enable
<=
0
;
end
FETCH_PARAMS:
begin
/* Operation registers:
...
...
@@ -257,8 +242,13 @@ module Matrix_Convolution (
/* Done state */
FSM_DONE:
begin
done
<=
1
;
// Turning the thing on
if
(
enable_edge
)
state
<=
START
;
if
(
!
last_enable
&&
enable
)
begin
// Turning the thing on
state
<=
START
;
end
else
begin
last_enable
<=
enable
;
end
end
endcase
end
...
...
This diff is collapsed.
Click to expand it.
verilog/src/chatgpt/Matrix_Multiplication.v
+
9
−
19
View file @
56acd3b0
...
...
@@ -65,21 +65,6 @@ module Matrix_Multiplication (
// Assign initial state
reg
last_enable
;
reg
enable_edge
;
always
@
(
posedge
clk
)
begin
if
(
reset
)
begin
enable_edge
<=
0
;
last_enable
<=
0
;
end
else
if
(
!
last_enable
&&
enable
)
begin
enable_edge
<=
1
;
last_enable
<=
0
;
end
else
begin
last_enable
<=
enable
;
end
end
always
@
(
posedge
clk
or
posedge
enable
)
begin
if
(
reset
)
begin
// reset dimensions
...
...
@@ -100,7 +85,7 @@ module Matrix_Multiplication (
result_buffer
<=
0
;
operator1_buffer
<=
0
;
operator2_buffer
<=
0
;
enabl
e_edg
e
<=
0
;
last_
enable
<=
0
;
end
else
begin
case
(
state
)
...
...
@@ -122,7 +107,7 @@ module Matrix_Multiplication (
result_buffer
<=
0
;
operator1_buffer
<=
0
;
operator2_buffer
<=
0
;
enabl
e_edg
e
<=
0
;
last_
enable
<=
0
;
end
FETCH_PARAMS:
begin
/* Operation registers:
...
...
@@ -226,8 +211,13 @@ module Matrix_Multiplication (
end
FSM_DONE:
begin
done
<=
1
;
// Turning the thing on
if
(
enable_edge
)
state
<=
START
;
if
(
!
last_enable
&&
enable
)
begin
// Turning the thing on
state
<=
START
;
end
else
begin
last_enable
<=
enable
;
end
end
endcase
end
...
...
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