Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
0639660e
Commit
0639660e
authored
Sep 06, 2017
by
Raimundas Bastys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed from positive to negative clock edge on spi data reading
parent
daeb5da2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
simul_sensor_spi.v
simulation_modules/simul_sensor_spi.v
+17
-2
No files found.
simulation_modules/simul_sensor_spi.v
View file @
0639660e
...
@@ -97,7 +97,7 @@ end
...
@@ -97,7 +97,7 @@ end
`define
S_FST_RD_A0 8
'
h03
`define
S_FST_RD_A0 8
'
h03
`define
S_FST_RD_D0 8
'
h04
`define
S_FST_RD_D0 8
'
h04
always
@
(
posedge
clk
)
begin
//todo: always begin @(posedge) begin end @(negedge) begin end
always
@
(
posedge
clk
)
begin
if
(
reset
)
begin
if
(
reset
)
begin
sfst
<=
`S_FST_00000
;
sfst
<=
`S_FST_00000
;
reg_addr
[
6
:
0
]
<=
0
;
reg_addr
[
6
:
0
]
<=
0
;
...
@@ -123,7 +123,7 @@ end else begin
...
@@ -123,7 +123,7 @@ end else begin
ciklu_addr
[
2
:
0
]
<=
ciklu_addr
[
2
:
0
]
-
1
;
ciklu_addr
[
2
:
0
]
<=
ciklu_addr
[
2
:
0
]
-
1
;
end
end
`S_FST_RD_D0
:
begin
`S_FST_RD_D0
:
begin
#
tSPI
spi_out
<=
sensor_spi_reg
[
reg_addr
[
6
:
0
]][
ciklu_addr
[
2
:
0
]]
;
//todo: pakeist fronta kai bus testbench
// #tSPI spi_out <= sensor_spi_reg[reg_addr[6:0]][ciklu_addr[2:0]];
if
(
ciklu_addr
[
2
:
0
]
==
3'b000
)
if
(
ciklu_addr
[
2
:
0
]
==
3'b000
)
sfst
<=
`S_FST_00000
;
sfst
<=
`S_FST_00000
;
else
else
...
@@ -150,5 +150,20 @@ end else begin
...
@@ -150,5 +150,20 @@ end else begin
end
//if
end
//if
end
//always
end
//always
always
@
(
negedge
clk
)
begin
if
(
reset
)
begin
spi_out
<=
1'b0
;
end
else
begin
case
(
sfst
)
`S_FST_RD_D0
:
begin
spi_out
<=
sensor_spi_reg
[
reg_addr
[
6
:
0
]][
ciklu_addr
[
2
:
0
]]
;
end
endcase
end
//if
end
//always
endmodule
endmodule
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment