Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main_to_vhdlprimitive #2

Open
wants to merge 541 commits into
base: vhdl_primitive
Choose a base branch
from
Open
Changes from 6 commits
Commits
Show all changes
541 commits
Select commit Hold shift + click to select a range
11aa9ac
my_i2c_fsm_combinational - fix conf
kedziorno Sep 2, 2021
e1f1caf
my_i2c_fsm_combinational - divide seq com versions
kedziorno Sep 2, 2021
1026abd
my_i2c_fsm_combinational - use fsm ver in tb
kedziorno Sep 2, 2021
428e750
my_i2c_fsm_combinational - use rc counter over sda_width
kedziorno Sep 2, 2021
d74d720
my_i2c_fsm_combinational - use rc counter over slave_address
kedziorno Sep 2, 2021
1c1f1c4
my_i2c_fsm_combinational - remove rc latches,i2c timings and start/st…
kedziorno Sep 2, 2021
8874fb9
Merge branch 'my_i2c_fsm_combinational' into main
kedziorno Sep 2, 2021
289a41c
my_i2c_fsm_combinational - wip - sdasck latches
kedziorno Sep 2, 2021
411880d
my_i2c_fsm_combinational - wip - sdasck latches
kedziorno Sep 3, 2021
c48592a
my_i2c_fsm_combinational - fix timing in RC,rc_q show normal incremen…
kedziorno Sep 4, 2021
cfb5a5e
my_i2c_fsm_combinational - add o_byte_sended flag,fix data_ack length
kedziorno Sep 4, 2021
4ba4ae0
my_i2c_fsm_combinational - fix timing in RC,rc_q show normal incremen…
kedziorno Sep 4, 2021
56a8d2a
my_i2c_fsm_combinational - wip - all characters sended in sim,prepare…
kedziorno Sep 4, 2021
7800d04
Merge branch 'my_i2c_fsm_combinational' into main
kedziorno Sep 4, 2021
86c09fa
my_i2c_fsm_combinational - wip - test1 fail,scl dont work,remove some…
kedziorno Sep 6, 2021
ea0731e
Merge branch 'main' into my_i2c_fsm_combinational
kedziorno Sep 7, 2021
6e6ab02
my_i2c_fsm_combinational - wip - test_oled_fsm remove some latches,re…
kedziorno Sep 7, 2021
757663b
my_i2c_fsm_combinational - wip - fix data_ack,remove some warnings
kedziorno Sep 7, 2021
f432233
my_i2c_fsm_combinational - wip - adjust rc1_q,glcdfont as block ram
kedziorno Sep 11, 2021
3b3c211
my_i2c_fsm_combinational - wip - remove some latches
kedziorno Sep 11, 2021
e8e84a2
my_i2c_fsm_combinational - wip - adjust glcdfont
kedziorno Sep 11, 2021
8ff8e17
my_i2c_fsm_combinational - wip - constant,gates lut2,i2c_fsm the same rc
kedziorno Sep 11, 2021
302e166
my_i2c_fsm_combinational - wip - remove o_ping from rc
kedziorno Sep 11, 2021
6c11b44
my_i2c_fsm_combinational - wip - use LUTs in FF_JK module and RC
kedziorno Sep 12, 2021
68f811d
my_i2c_fsm_combinational - wip - use LUT_L ver in gates,rc,proj set
kedziorno Sep 13, 2021
aceebfb
my_i2c_fsm_combinational - wip - resource sharing disable
kedziorno Sep 13, 2021
0578ac1
my_i2c_fsm_combinational - wip - remove sck/sda latches from i2c comb…
kedziorno Sep 26, 2021
2dc04c0
my_i2c_fsm_combinational - wip - use synch reset,change clock
kedziorno Sep 26, 2021
03935f7
my_i2c_fsm_combinational - wip - must fix sda_stop cond,latches go out
kedziorno Sep 26, 2021
a687b31
my_i2c_fsm_combinational - wip - work
kedziorno Sep 28, 2021
7e879e8
my_i2c_fsm_combinational - wip - test constraint
kedziorno Oct 5, 2021
3d9f551
my_i2c_fsm_combinational - wip - test constraint,improve blocks align…
kedziorno Oct 6, 2021
4d09934
my_i2c_fsm_combinational - wip - syn reset,change strategy
kedziorno Oct 12, 2021
1d4d627
my_i2c_fsm_combinational - wip - syn reset,change strategy
kedziorno Oct 12, 2021
9c307c6
my_i2c_fsm_combinational - wip - loc/rloc
kedziorno Oct 17, 2021
f83b318
rloc_rc - wip - copy files for test
kedziorno Oct 17, 2021
fce7fd5
rloc_rc - wip - fix
kedziorno Oct 17, 2021
8faf06a
rloc_rc - wip - fix the counter,sim works ok
kedziorno Oct 17, 2021
cccdeec
rloc_rc - wip - probe to adjust one FF_JK from X0Y0
kedziorno Oct 24, 2021
1c74654
rloc_rc - wip - probe for ffjk_first_1
kedziorno Nov 1, 2021
058b816
rloc_rc - wip - X0Y0 FF_JK after fill UCF file
kedziorno Nov 1, 2021
71b64d1
my_i2c_fsm_combinational - wip - oscillations
kedziorno Nov 2, 2021
b9f9754
my_i2c_fsm_combinational - wip - revert to worked version,PULLUPH not…
kedziorno Nov 2, 2021
7a63913
rloc_rc - wip - attributes for rc
kedziorno Nov 7, 2021
e31c85c
rloc_rc - wip - better fill rc from X12Y8
kedziorno Nov 7, 2021
de1e850
rloc_rc - wip - better fill rc from X12Y8
kedziorno Nov 7, 2021
382fb02
Merge branch 'my_i2c_fsm_combinational' into main
kedziorno Nov 7, 2021
cea307a
Merge branch 'rloc_rc' into main
kedziorno Nov 7, 2021
526a0d5
rloc_rc - wip - loc for gates,hu_set probe
kedziorno Nov 8, 2021
2d4b125
rloc_rc - wip - hu_set probe,luts on the right-botton corner device
kedziorno Nov 8, 2021
f6a5a07
rloc_rc - wip - hu_set probe,luts on the right-botton corner device
kedziorno Nov 8, 2021
32a959e
rloc_rc - stacking blocks with rloc/h_set looks promising
kedziorno Nov 9, 2021
53a5e50
Merge branch 'rloc_rc' into main
kedziorno Nov 9, 2021
e86c1f1
rloc_rc - fix rc sim
kedziorno Nov 10, 2021
31c5073
Merge branch 'rloc_rc' into main
kedziorno Nov 27, 2021
cb76d26
wbj - add desc
kedziorno Nov 27, 2021
f183ef8
wbj - uart - add 74hct32
kedziorno Nov 28, 2021
7b2a34e
wbj - uart - add u9 module from sch
kedziorno Nov 28, 2021
4eb90cb
wbj - uart - wip - ic_74htc193
kedziorno Dec 1, 2021
f197462
wbj - uart - wip - ic_74htc193 add gates, syn ok
kedziorno Dec 2, 2021
fbf363b
wbj - uart - wip - ic_74htc193 add tb,test1 fail,maybe use other ff
kedziorno Dec 3, 2021
4e8cebd
wbj - uart - wip - ic_74htc193 use converted fft from ldcpe,reset wor…
kedziorno Dec 5, 2021
50dd905
wbj - uart - wip - ic_74htc193 add converted_ldcpe2fft tb
kedziorno Dec 5, 2021
bb82ba9
wbj - uart - wip - ic_74htc193 use delayed circuit in ldcpe2fft mod
kedziorno Dec 6, 2021
c20822d
wbj - uart - wip - ic_74htc193 counting better
kedziorno Dec 6, 2021
6de339c
wbj - uart - ic_74htc193 correct counting,use new version tb
kedziorno Dec 6, 2021
5308f34
wbj - uart - ic_74htc193 add i_pl test to tb - parallel load
kedziorno Dec 6, 2021
dbb8524
wbj - uart - ic_74htc193 add LUT5 module for make nand5 gate
kedziorno Dec 7, 2021
7c348f3
wbj - uart - add u5 module from sch
kedziorno Dec 7, 2021
934910b
wbj - uart - add u7 u8 module from sch
kedziorno Dec 8, 2021
c31793e
wbj - uart - add 74hct164
kedziorno Dec 8, 2021
fa71dd0
wbj - uart - add similar sn74als165 similar to 74hct165
kedziorno Dec 9, 2021
981a8c1
wbj - uart - add u10 u11 module from sch
kedziorno Dec 9, 2021
09ac1ec
wbj - uart - add 74hct574
kedziorno Dec 9, 2021
cde5f11
wbj - uart - wip - tb some run
kedziorno Dec 11, 2021
956a2f6
wbj - uart - wip - fix
kedziorno Dec 11, 2021
3327688
wbj - uart - wip - fix
kedziorno Dec 11, 2021
93b2f0c
wbj - uart - wip - fix
kedziorno Dec 11, 2021
f030489
wbj - uart - wip - add reset,tb rewrite
kedziorno Dec 11, 2021
0afb9a7
wbj - uart - fix 74hct00
kedziorno Dec 11, 2021
a572aff
wbj - uart - wip - tx show signal ver1
kedziorno Dec 11, 2021
fef8c1d
wbj - uart - wip - tx show more dense signal ver2
kedziorno Dec 11, 2021
18cbe76
wbj - uart - fix
kedziorno Dec 12, 2021
9429c51
wbj_uart_ver2 - wip - test1
kedziorno Dec 12, 2021
9c35c54
wbj_uart_ver2 - test2 - works better but send multiple time the same …
kedziorno Dec 13, 2021
b79d5a4
wbj_uart_ver2 - test2 - adjust tb
kedziorno Dec 13, 2021
352a368
Merge branch 'vhdl_primitive' into main
kedziorno Dec 14, 2021
84eeb88
Merge branch 'weirdboyjim_circuits' into main
kedziorno Dec 14, 2021
7c4c0ff
wbj - uart - wip - add delayed nots
kedziorno Dec 14, 2021
8028842
wbj - uart - wip - test with ldcpe
kedziorno Dec 14, 2021
31de680
wbj - uart - wip - test with ff_d_gated
kedziorno Dec 15, 2021
ff757b7
wbj - uart - tx show patterns with ff_d_gated
kedziorno Dec 16, 2021
7c40a37
wbj - uart - fix tb
kedziorno Dec 16, 2021
d203cff
wbj - uart - tb timings looks ok, tx byte have 4.608us
kedziorno Dec 17, 2021
7eb57c6
Merge branch 'weirdboyjim_circuits' into main
kedziorno Dec 17, 2021
de9310e
wbj - uart - wip - test converted_ldcpe2fft with ff_d_ms and ff_d_det
kedziorno Dec 17, 2021
fa57eb3
wbj - uart - wip - use NOTs chain for delayed tx pulse,tx pattern 66.…
kedziorno Dec 18, 2021
f3208bc
Merge branch 'weirdboyjim_circuits' into main
kedziorno Dec 18, 2021
3663842
Merge branch 'vhdl_primitive' into main
kedziorno Dec 19, 2021
4bebd7a
wbj - uart - wip - add delayed_circuit mod,dc work
kedziorno Dec 20, 2021
dda092b
wbj - uart - wip - add package for constants
kedziorno Dec 20, 2021
2a10590
wbj - uart - wip - dc test
kedziorno Dec 20, 2021
a104d96
wbj - uart - wip - converted_ldcpe2fft rewrite and test ff_d_pe
kedziorno Dec 27, 2021
950e848
wbj - uart - wip - converted_ldcpe2fft rewrite and test ff_d_pe
kedziorno Dec 29, 2021
24a68c0
wbj - uart - wip - converted_ldcpe2fft use ff_jk and u5 mod count ok
kedziorno Dec 29, 2021
00a84ab
Merge branch 'weirdboyjim_circuits' into main
kedziorno Dec 29, 2021
d9462ba
wbj - uart - fix ic_74hct193,tb show normal tx pattern
kedziorno Jan 4, 2022
d376d18
wbj - uart - fix ic_74hct193,tb show normal tx pattern,fix tb - tx wo…
kedziorno Jan 4, 2022
dea55c6
wbj - uart - fix ic_74hct193,tb show normal tx pattern,adjust delays
kedziorno Jan 4, 2022
30e6810
wbj - uart - fix ic_74hct193,tb show normal tx pattern,fix tb
kedziorno Jan 4, 2022
ed73b43
Merge branch 'weirdboyjim_circuits' into main
kedziorno Jan 4, 2022
cd81c44
wbj - uart - wip - add rx sch
kedziorno Jan 5, 2022
0511366
wbj - uart - wip - rewrite rx tx tb
kedziorno Jan 5, 2022
c97b091
wbj - uart - wip - rewrite tb,separate 2 clock rx tx
kedziorno Jan 5, 2022
06bf98b
wbj - uart - fix ic_74hct193,add edge detector rising edge on cpu cpd
kedziorno Jan 6, 2022
ffd7683
wbj - uart - rewrite tb
kedziorno Jan 6, 2022
f51e563
wbj - uart - wip - revdata show some patterns from rx,test1
kedziorno Jan 6, 2022
02fccb7
wbj - uart - wip - rx adjust tb
kedziorno Jan 6, 2022
1a1c1ac
wbj - uart - wip - rx adjust tb,strange - work without RX stop
kedziorno Jan 6, 2022
bf96652
wbj - uart - wip - adjust tb
kedziorno Jan 7, 2022
4e21ec7
wbj - uart - in tb add TCL scripts for marker add and run simulation
kedziorno Jan 7, 2022
e2b43dd
wbj - uart - wip - adjust tb
kedziorno Jan 7, 2022
b9fd962
Merge branch 'weirdboyjim_circuits' into main
kedziorno Jan 7, 2022
43aeb56
wbj - wip - add ic_74hct161 mod and tb
kedziorno Jan 8, 2022
0093ff5
wbj - wip - add ic_74hct161 mod and tb,test with ffce,work
kedziorno Jan 9, 2022
f212083
wbj - wip - add ic_74hct163 mod and tb,rewrite tb for timings,work
kedziorno Jan 9, 2022
b573aac
wbj - wip - 74hct161 test other ff
kedziorno Jan 10, 2022
d748d29
wbj - wip - 74hct161 test other ff
kedziorno Jan 11, 2022
7619514
wbj - wip - 74hct161 test other ff
kedziorno Jan 12, 2022
34902cf
init commit isim
Jan 12, 2022
b23f146
main states signal
Jan 12, 2022
5cb6f32
fix b state
Jan 12, 2022
326b496
add reversside phase
Jan 12, 2022
e76b78a
delay detector
Jan 12, 2022
47c6407
add lcd
Jan 14, 2022
846453f
add lcd
Jan 14, 2022
2afc612
add ucf
Jan 14, 2022
8d061fc
add bcd calculate
Jan 14, 2022
9f7b441
fix bcd
Jan 14, 2022
393610f
use 4 bcd
Jan 14, 2022
36f7925
rewrite tb
Jan 14, 2022
cf1d327
rewrite tb
Jan 14, 2022
6e8a585
rewrite tb
Jan 15, 2022
dedbd75
lcd reset
Jan 15, 2022
dce5601
rewrite tb
Jan 15, 2022
f7f784b
rewrite tb
Jan 15, 2022
dd3660b
rewrite tb
Jan 15, 2022
7676fa7
rewrite tb,all tests work
Jan 15, 2022
74014c7
add comments
Jan 15, 2022
3bfa6cf
myow_i2c - fix
kedziorno Jan 17, 2022
0bcd202
myown_i2c_pc - add files
kedziorno Jan 17, 2022
ecd081b
myown_i2c_pc - sda start condition after N/2 cycles
kedziorno Jan 17, 2022
2777ccb
myown_i2c_pc - sda start condition after N/2 cycles,add scl clock N c…
kedziorno Jan 18, 2022
58d4292
myown_i2c_pc - rewrite names,add mux 41
kedziorno Jan 18, 2022
0f64f9d
myown_i2c_pc - rewrite names,add some flags for N sda_chain
kedziorno Jan 18, 2022
742d7f0
myown_i2c_pc - add encoder42 process
kedziorno Jan 19, 2022
1364d90
myown_i2c_pc - use i_clock
kedziorno Jan 19, 2022
66dc942
myown_i2c_pc - start and stop condition have ~3 cycles
kedziorno Jan 19, 2022
24ce230
myown_i2c_pc - use generic N
kedziorno Jan 20, 2022
3b4bd1d
myown_i2c_pc - add address to sda
kedziorno Jan 20, 2022
00ef570
myown_i2c_pc - rewrite start,address,rw,ack,stop
kedziorno Jan 20, 2022
7c6c650
myown_i2c_pc - fix i_slave_address syn,fix MUXs
kedziorno Jan 21, 2022
eb75a49
myown_i2c_pc - add i_bytes_to_send based on o_busy,add tb data bytes
kedziorno Jan 21, 2022
b59cf1a
myown_i2c_pc - add data ack bit
kedziorno Jan 22, 2022
263a736
myown_i2c_pc - add data ack bit,add stop condition
kedziorno Jan 22, 2022
10bfcc0
myown_i2c_pc - add data ack bit,add stop condition,fix synthsesis
kedziorno Jan 22, 2022
9b70e90
myown_i2c_pc - add sda scl 3st output
kedziorno Jan 22, 2022
60ebd95
myown_i2c - merge,todo fix
kedziorno Jan 24, 2022
ebc567e
init commit isim
Jan 12, 2022
e48e309
main states signal
Jan 12, 2022
ccbe22b
fix b state
Jan 12, 2022
9c538ef
add reversside phase
Jan 12, 2022
c1f1202
delay detector
Jan 12, 2022
39d7cde
add lcd
Jan 14, 2022
b70bd0a
add lcd
Jan 14, 2022
e0a86b4
add ucf
Jan 14, 2022
356df59
add bcd calculate
Jan 14, 2022
7a39c96
fix bcd
Jan 14, 2022
2e47d90
use 4 bcd
Jan 14, 2022
4665c48
rewrite tb
Jan 14, 2022
092c0fa
rewrite tb
Jan 14, 2022
2ea5ae2
rewrite tb
Jan 15, 2022
68fd5cd
lcd reset
Jan 15, 2022
241cd3b
rewrite tb
Jan 15, 2022
601ca02
rewrite tb
Jan 15, 2022
e741050
rewrite tb
Jan 15, 2022
52006ad
rewrite tb,all tests work
Jan 15, 2022
a5eac32
add comments
Jan 15, 2022
0232865
Merge branch 'sr' into main
kedziorno Jan 24, 2022
eddcedc
myown_i2c - fix,wip to use i2c_pc
kedziorno Jan 24, 2022
f9385e0
myown_i2c - test1,board show something
kedziorno Jan 24, 2022
c535780
myown_i2c - wip
kedziorno Jan 26, 2022
317834c
myown_i2c_pc2 - new version ripple_counter, work
kedziorno Jan 27, 2022
3a8d48d
myown_i2c_pc2 - add start condition with ripple_counter
kedziorno Jan 28, 2022
e675bee
myown_i2c_pc2 - start stop sda condition with the same rc
kedziorno Jan 29, 2022
f0516dd
myown_i2c_pc2 - wip,more rc's
kedziorno Jan 29, 2022
0a7e663
Merge branch 'weirdboyjim_circuits' into main
kedziorno Jan 29, 2022
371b055
myown_i2c_pc2 - sda start and stop signals
kedziorno Jan 30, 2022
8253395
myown_i2c_pc2 - sda start and stop signals,fix synthesis
kedziorno Jan 30, 2022
221cd6a
Merge branch 'myown_i2c' into main
kedziorno Jan 30, 2022
8e97869
myown_i2c_pc2 - add ic hef4027b,wip
kedziorno Jan 31, 2022
354d859
myown_i2c_pc2 - add ic hef4027b,wip
kedziorno Jan 31, 2022
9d17b3c
myown_i2c_pc2 - add ic hef4027b,wip
kedziorno Feb 1, 2022
0ed07bb
myown_i2c_pc2 - add ic hef4027b,wip
kedziorno Feb 1, 2022
a63e81c
myown_i2c_pc2 - add ic hef4027b,sim see works better
kedziorno Feb 2, 2022
6a0874b
myown_i2c_pc2 - add ic hef4027b,sim see works better,replace jk
kedziorno Feb 2, 2022
1d6f451
myown_i2c_pc2 - add ic hef4027b,sim see works better,replace jk,tb ch…
kedziorno Feb 2, 2022
55453b8
myown_i2c_pc2 - add ic 74hc73
kedziorno Feb 2, 2022
f93fddb
myown_i2c_pc2 - rewrite transmission_gate
kedziorno Feb 3, 2022
b55fd6b
myown_i2c_pc2 - wip tg
kedziorno Feb 4, 2022
3322d3e
myown_i2c_pc2 - wip tg
kedziorno Feb 4, 2022
f65a139
Merge branch 'myown_i2c' into main
kedziorno Feb 4, 2022
106a340
myown_i2c_pc2 - wip tg
kedziorno Feb 4, 2022
99dfccc
Merge branch 'myown_i2c' into main
kedziorno Feb 4, 2022
6cc2063
myown_i2c_pc2 - wip tg
kedziorno Feb 15, 2022
faf51a6
myown_i2c_pc2 - wip tg
kedziorno Feb 23, 2022
39883e7
add readme and GIFs
kedziorno Mar 29, 2022
92d3fda
update readme
kedziorno Mar 29, 2022
cbc9a25
add readme and GIFs
kedziorno Mar 29, 2022
b34f730
adc_counter - 8 bit, rom table modified
kedziorno Jun 20, 2022
0abee35
Merge branch 'adc_counter'
kedziorno Jun 20, 2022
8e32284
camera1 - wip - add 640x480 vga counters
kedziorno Jun 23, 2022
29cfc70
camera1 - work vga timings and add demo
kedziorno Jun 24, 2022
ae53412
camera1 - wip - working example but colors is strange and image is cr…
kedziorno Jun 26, 2022
a73f33d
camera1 - wip - working example but colors is strange and image is cr…
kedziorno Jun 26, 2022
af45327
camera1 - wip - asd
kedziorno Jul 9, 2022
c4441a7
camera1 - wip - asd
kedziorno Jul 9, 2022
842bd91
camera1 - wip - add simple camera emulator
kedziorno Jul 10, 2022
774bbbd
camera1 - wip - test1 - camera work
kedziorno Jul 11, 2022
b14679a
camera1 - wip - add top files
kedziorno Jul 11, 2022
d2da55d
camera1 - wip - add comment to registers in controller
kedziorno Jul 11, 2022
2ca32de
camera1 - wip - revert default files from example
kedziorno Jul 12, 2022
ece801c
camera1 - wip - revert the fixes to example
kedziorno Jul 12, 2022
8641ae5
camera3 - wip - add files
kedziorno Jul 13, 2022
5daea2f
camera3 - ok stable image from camera emulator
kedziorno Jul 14, 2022
a5ef446
Merge remote-tracking branch 'refs/remotes/origin/main'
kedziorno Jul 28, 2022
ea4bacc
update README.md and GIFs
kedziorno Jul 28, 2022
25c0f9b
update readme
kedziorno Aug 15, 2022
b92a4cb
Merge branch 'readme'
kedziorno Aug 15, 2022
0d6e7a0
Merge branch 'camera3'
kedziorno Aug 21, 2022
cf4e08c
add camera qqvga emulator
kedziorno Aug 21, 2022
9239790
Merge branch 'camera3'
kedziorno Aug 21, 2022
3101788
Merge remote-tracking branch 'refs/remotes/origin/main'
kedziorno Aug 21, 2022
f4f1642
Merge branch 'myown_i2c'
kedziorno Aug 21, 2022
ee45b53
Merge branch 'vhdl_primitive'
kedziorno Aug 21, 2022
3e6f8ea
update README.md and GIFs
kedziorno Sep 6, 2022
b6ad2bc
gof and my_i2c
kedziorno Apr 2, 2024
be56d7b
Merge branch 'vhdl_primitive'
kedziorno Dec 4, 2024
5b4fe6d
Merge branch 'vhdl_primitive'
kedziorno Dec 4, 2024
545e9b4
Merge branch 'vhdl_primitive'
kedziorno Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 110 additions & 69 deletions myown_i2c/my_i2c_fsm.vhd
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ architecture Behavioral of my_i2c_fsm is

type clock_mode is (c0,c1,c2,c3);
signal c_cmode0,n_cmode0 : clock_mode;
signal c_cmode0_rc1 : std_logic;
signal c_cmode0_rc_clock : std_logic;

component ripple_counter is
Generic (
@@ -87,25 +87,57 @@ architecture Behavioral of my_i2c_fsm is
o_ping : out std_logic
);
end component ripple_counter;
constant RC_N : integer := 4;
constant RC_MAX : integer := G_BYTE_SIZE;
constant RC0_N : integer := 4;
constant RC0_MAX : integer := G_SLAVE_ADDRESS_SIZE*2;
signal rc0_cpb,rc0_mrb : std_logic;
signal rc0_q : std_logic_vector(RC0_N-1 downto 0);
signal rc0_ping : std_logic;
constant RC1_N : integer := 4;
constant RC1_MAX : integer := G_BYTE_SIZE;
signal rc1_cpb,rc1_mrb : std_logic;
signal rc1_q : std_logic_vector(RC_N-1 downto 0);
signal rc1_q : std_logic_vector(RC1_N-1 downto 0);
signal rc1_ping : std_logic;
constant RC2_N : integer := 2;
constant RC2_MAX : integer := 2;
signal rc2_cpb,rc2_mrb : std_logic;
signal rc2_q : std_logic_vector(RC2_N-1 downto 0);
signal rc2_ping : std_logic;

begin

entity_rc0 : ripple_counter
Generic map (N => RC0_N, MAX => RC0_MAX)
Port map (
i_clock => c_cmode0_rc_clock,
i_cpb => rc0_cpb,
i_mrb => rc0_mrb,
i_ud => '1',
o_q => rc0_q,
o_ping => rc0_ping
);

entity_rc1 : ripple_counter
Generic map (N => RC_N, MAX => RC_MAX)
Generic map (N => RC1_N, MAX => RC1_MAX)
Port map (
i_clock => c_cmode0_rc1,
i_clock => c_cmode0_rc_clock,
i_cpb => rc1_cpb,
i_mrb => rc1_mrb,
i_ud => '1',
o_q => rc1_q,
o_ping => rc1_ping
);

entity_rc2 : ripple_counter
Generic map (N => RC2_N, MAX => RC2_MAX)
Port map (
i_clock => c_cmode0_rc_clock,
i_cpb => rc2_cpb,
i_mrb => rc2_mrb,
i_ud => '1',
o_q => rc2_q,
o_ping => rc2_ping
);

i2c_clock_process : process (i_clock) is
constant I2C_COUNTER_MAX : integer := (BOARD_CLOCK / BUS_CLOCK) / 4;
variable count : integer range 0 to (I2C_COUNTER_MAX*4)-1;
@@ -141,16 +173,16 @@ begin
case c_cmode0 is
when c0 =>
n_cmode0 <= c1;
c_cmode0_rc1 <= '1';
c_cmode0_rc_clock <= '1';
when c1 =>
n_cmode0 <= c2;
c_cmode0_rc1 <= '0';
c_cmode0_rc_clock <= '0';
when c2 =>
n_cmode0 <= c3;
c_cmode0_rc1 <= '0';
c_cmode0_rc_clock <= '0';
when c3 =>
n_cmode0 <= c0;
c_cmode0_rc1 <= '0';
c_cmode0_rc_clock <= '0';
end case;
end process clock_mode_0_com;

@@ -166,21 +198,18 @@ begin
end process p2;

i2c_send_sequence_fsm : process (c_state,c_cmode0,i_enable,i_slave_address,i_bytes_to_send) is
constant SLAVE_INDEX_MAX : integer := G_SLAVE_ADDRESS_SIZE;
constant SDA_WIDTH_MAX : integer := 2;
variable data_index : std_logic_vector(G_BYTE_SIZE-1 downto 0);
variable slave_index : integer range 0 to SLAVE_INDEX_MAX-1;
variable sda_width: integer range 0 to SDA_WIDTH_MAX-1;
variable vtemp_sda,vtemp_sck : std_logic;
begin
n_state <= c_state;
case c_state is
when idle =>
slave_index := 0;
rc0_mrb <= '1';
rc1_mrb <= '1';
rc2_mrb <= '1';
rc0_cpb <= '0';
rc1_cpb <= '0';
rc2_cpb <= '0';
o_busy <= '0';
sda_width := 0;
vtemp_sda := '1';
vtemp_sck := '1';
if (i_enable = '1') then
@@ -189,10 +218,12 @@ begin
n_state <= idle;
end if;
when sda_start =>
slave_index := 0;
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
sda_width := 0;
rc2_cpb <= '0';
if (c_cmode0 = c0) then
vtemp_sck := '1';
vtemp_sda := '1';
@@ -203,10 +234,12 @@ begin
end if;
o_busy <= '1';
when start =>
slave_index := 0;
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
sda_width := 0;
rc2_cpb <= '0';
if (c_cmode0 = c0) then
vtemp_sda := '0';
vtemp_sck := '1';
@@ -216,55 +249,58 @@ begin
vtemp_sck := vtemp_sck;
end if;
o_busy <= '1';
vtemp_sda := vtemp_sda;
vtemp_sck := vtemp_sck;
when slave_address =>
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '1';
rc1_cpb <= '0';
rc2_cpb <= '0';
o_busy <= '1';
sda_width := 0;
if (c_cmode0 /= c1 and c_cmode0 /= c2 and (c_cmode0 = c0 or c_cmode0 = c3)) then
vtemp_sck := '0';
end if;
if ((c_cmode0 = c1 or c_cmode0 = c2) and c_cmode0 /= c0 and c_cmode0 /= c3) then
vtemp_sck := '1';
end if;
if (slave_index /= SLAVE_INDEX_MAX-1) then
if (to_integer(unsigned(rc0_q)) = G_SLAVE_ADDRESS_SIZE-1) then
n_state <= slave_address_lastbit;
else
if (c_cmode0 = c0) then
vtemp_sda := i_slave_address(slave_index);
slave_index := slave_index + 1;
vtemp_sda := i_slave_address(to_integer(unsigned(rc0_q)));
n_state <= slave_address;
else
vtemp_sda := vtemp_sda;
vtemp_sck := vtemp_sck;
n_state <= slave_address;
end if;
else
n_state <= slave_address_lastbit;
end if;
when slave_address_lastbit =>
slave_index := 0;
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
rc2_cpb <= '0';
o_busy <= '1';
sda_width := 0;
if (c_cmode0 /= c1 and c_cmode0 /= c2 and (c_cmode0 = c0 or c_cmode0 = c3)) then
vtemp_sck := '0';
end if;
if ((c_cmode0 = c1 or c_cmode0 = c2) and c_cmode0 /= c0 and c_cmode0 /= c3) then
vtemp_sck := '1';
end if;
if (c_cmode0 = c0) then
vtemp_sda := i_slave_address(SLAVE_INDEX_MAX-1);
vtemp_sda := i_slave_address(G_SLAVE_ADDRESS_SIZE-1);
n_state <= slave_rw;
end if;
vtemp_sda := vtemp_sda;
vtemp_sck := vtemp_sck;
when slave_rw =>
slave_index := 0;
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
rc2_cpb <= '0';
o_busy <= '1';
sda_width := 0;
if (c_cmode0 /= c1 and c_cmode0 /= c2 and (c_cmode0 = c0 or c_cmode0 = c3)) then
vtemp_sck := '0';
end if;
@@ -279,11 +315,13 @@ begin
vtemp_sck := vtemp_sck;
end if;
when slave_ack =>
slave_index := 0;
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
rc2_cpb <= '0';
o_busy <= '1';
sda_width := 0;
if (c_cmode0 /= c1 and c_cmode0 /= c2 and (c_cmode0 = c0 or c_cmode0 = c3)) then
vtemp_sck := '0';
end if;
@@ -297,10 +335,12 @@ begin
vtemp_sda := vtemp_sda;
vtemp_sck := vtemp_sck;
when data =>
sda_width := 0;
slave_index := 0;
rc1_cpb <= '1';
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '1';
rc2_cpb <= '0';
o_busy <= '1';
if (c_cmode0 /= c1 and c_cmode0 /= c2 and (c_cmode0 = c0 or c_cmode0 = c3)) then
vtemp_sck := '0';
@@ -321,69 +361,70 @@ begin
end if;
when data_ack =>
o_busy <= '1';
slave_index := 0;
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
rc2_cpb <= '1';
if (c_cmode0 /= c1 and c_cmode0 /= c2 and (c_cmode0 = c0 or c_cmode0 = c3)) then
vtemp_sck := '0';
end if;
if ((c_cmode0 = c1 or c_cmode0 = c2) and c_cmode0 /= c0 and c_cmode0 /= c3) then
vtemp_sck := '1';
end if;
if (c_cmode0 = c0) then
vtemp_sda := '0';
if (sda_width = SDA_WIDTH_MAX-1) then -- XXX latch
sda_width := 0;
vtemp_sda := '1';
end if;
if (to_integer(unsigned(rc2_q)) = RC2_MAX-1) then
if (i_enable = '1') then
n_state <= data;
sda_width := 0;
else
n_state <= stop;
sda_width := 0;
end if;
else
sda_width := sda_width + 1;
n_state <= data_ack;
end if;
sda_width := sda_width;
end if;
vtemp_sda := vtemp_sda;
vtemp_sck := vtemp_sck;
when stop =>
o_busy <= '1';
slave_index := 0;
sda_width := 0;
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
rc2_cpb <= '0';
if (c_cmode0 /= c1 and c_cmode0 /= c2 and (c_cmode0 = c0 or c_cmode0 = c3)) then
vtemp_sck := '0';
end if;
if ((c_cmode0 = c1 or c_cmode0 = c2) and c_cmode0 /= c0 and c_cmode0 /= c3) then
vtemp_sck := '1';
end if;
vtemp_sda := '0';
n_state <= sda_stop;
when sda_stop =>
sda_width := 0;
rc1_mrb <= '0';
rc1_cpb <= '0';
if (c_cmode0 = c0) then
n_state <= idle;
else
vtemp_sda := '0';
n_state <= sda_stop;
vtemp_sck := '1';
vtemp_sda := '1';
end if;
slave_index := 0;
when sda_stop =>
rc0_mrb <= '0';
rc1_mrb <= '0';
rc2_mrb <= '0';
rc0_cpb <= '0';
rc1_cpb <= '0';
rc2_cpb <= '0';
n_state <= idle;
vtemp_sck := '1';
vtemp_sda := '0';
o_busy <= '1';
when others =>
-- vtemp_sda := vtemp_sda;
-- vtemp_sck := vtemp_sck;
o_busy <= '0';
rc1_mrb <= '0';
n_state <= idle;
rc0_mrb <= '1';
rc1_mrb <= '1';
rc2_mrb <= '1';
rc0_cpb <= '0';
rc1_cpb <= '0';
sda_width := 0;
slave_index := 0;
rc2_cpb <= '0';
o_busy <= '0';
end case;
temp_sda <= vtemp_sda;
temp_sck <= vtemp_sck;
Loading