Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp-loto-etudiant-m24gomes
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
tp-vhdl-mee
MEDCON
gr-vhdl-m24gomes
tp-loto-etudiant-m24gomes
Commits
47851b9a
Commit
47851b9a
authored
1 year ago
by
Jean-Noël Bazin
Browse files
Options
Downloads
Patches
Plain Diff
update tirage
parent
c4f63948
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/comparateur.vhd
+0
-30
0 additions, 30 deletions
src/comparateur.vhd
src/registres.vhd
+11
-11
11 additions, 11 deletions
src/registres.vhd
src/tirage.vhd
+115
-90
115 additions, 90 deletions
src/tirage.vhd
with
126 additions
and
131 deletions
src/comparateur.vhd
deleted
100644 → 0
+
0
−
30
View file @
c4f63948
library
IEEE
;
use
IEEE
.
std_logic_1164
.
all
;
use
IEEE
.
numeric_std
.
all
;
entity
comparateur
is
port
(
I_reg0
:
in
std_logic_vector
(
5
downto
0
);
I_reg1
:
in
std_logic_vector
(
5
downto
0
);
I_reg2
:
in
std_logic_vector
(
5
downto
0
);
I_reg3
:
in
std_logic_vector
(
5
downto
0
);
I_reg4
:
in
std_logic_vector
(
5
downto
0
);
I_nombre_courant
:
in
std_logic_vector
(
5
downto
0
);
O_invalide
:
out
std_logic
);
end
entity
comparateur
;
architecture
arch
of
comparateur
is
begin
invalide
<=
'1'
when
(
I_reg0
=
I_nombre_courant
or
I_reg1
=
I_nombre_courant
or
I_reg2
=
I_nombre_courant
or
I_reg3
=
I_nombre_courant
or
I_reg4
=
I_nombre_courant
)
else
'0'
;
end
architecture
arch
;
This diff is collapsed.
Click to expand it.
src/registres.vhd
+
11
−
11
View file @
47851b9a
...
...
@@ -5,17 +5,17 @@ use IEEE.numeric_std.all;
entity
registres
is
port
(
I_clk
:
in
std_logic
;
I_rst
:
in
std_logic
;
I_wr
:
in
std_logic
;
I_adr
:
in
std_logic_vector
(
2
downto
0
);
I_data
:
in
std_logic_vector
(
5
downto
0
);
O_reg0
:
out
std_logic_vector
(
5
downto
0
)
O_reg1
:
out
std_logic_vector
(
5
downto
0
)
O_reg2
:
out
std_logic_vector
(
5
downto
0
)
O_reg3
:
out
std_logic_vector
(
5
downto
0
)
O_reg4
:
out
std_logic_vector
(
5
downto
0
)
O_reg5
:
out
std_logic_vector
(
5
downto
0
)
I_clk
:
in
std_logic
;
I_rst
:
in
std_logic
;
I_wr
:
in
std_logic
;
I_adr
:
in
std_logic_vector
(
2
downto
0
);
I_data
:
in
std_logic_vector
(
5
downto
0
);
O_reg0
:
out
std_logic_vector
(
5
downto
0
)
;
O_reg1
:
out
std_logic_vector
(
5
downto
0
)
;
O_reg2
:
out
std_logic_vector
(
5
downto
0
)
;
O_reg3
:
out
std_logic_vector
(
5
downto
0
)
;
O_reg4
:
out
std_logic_vector
(
5
downto
0
)
;
O_reg5
:
out
std_logic_vector
(
5
downto
0
)
);
end
registres
;
...
...
This diff is collapsed.
Click to expand it.
src/tirage.vhd
+
115
−
90
View file @
47851b9a
...
...
@@ -26,141 +26,166 @@ architecture a_tirage of tirage is
component
automate
is
port
(
rst
,
clk
:
in
std_logic
;
clk_display
,
bouton
,
invalide
,
fin
:
in
std_logic
;
comptage
:
out
std_logic
;
enregistrement
:
out
std_logic
;
l_rouge
:
out
std_logic
;
l_verte
:
out
std_logic
);
end
component
;
I_clk
:
in
std_logic
;
I_rst
:
in
std_logic
;
I_bouton
:
in
std_logic
;
I_clk_display
:
in
std_logic
;
I_bouton
:
in
std_logic
;
I_invalide
:
in
std_logic
;
I_fin
:
in
std_logic
;
O_comptage
:
out
std_logic
;
O_enregistrement
:
out
std_logic
;
O_l_rouge
:
out
std_logic
;
O_l_verte
:
out
std_logic
);
end
component
automate
;
component
registres
is
port
(
clk
,
rst
:
in
std_logic
;
enregistre
:
in
std_logic
;
adr
:
in
std_logic_vector
(
2
downto
0
);
numero_courant
:
in
std_logic_vector
(
5
downto
0
);
reg0
,
reg1
,
reg2
,
reg3
,
reg4
,
reg5
:
out
std_logic_vector
(
5
downto
0
)
);
end
component
;
I_clk
:
in
std_logic
;
I_rst
:
in
std_logic
;
I_wr
:
in
std_logic
;
I_adr
:
in
std_logic_vector
(
2
downto
0
);
I_data
:
in
std_logic_vector
(
5
downto
0
);
O_reg0
:
out
std_logic_vector
(
5
downto
0
);
O_reg1
:
out
std_logic_vector
(
5
downto
0
);
O_reg2
:
out
std_logic_vector
(
5
downto
0
);
O_reg3
:
out
std_logic_vector
(
5
downto
0
);
O_reg4
:
out
std_logic_vector
(
5
downto
0
);
O_reg5
:
out
std_logic_vector
(
5
downto
0
));
end
component
registres
;
component
compteur_valid
is
port
(
clk
,
rst
,
comptage
:
in
std_logic
;
adr
:
out
std_logic_vector
(
2
downto
0
)
;
fin
:
out
std_logic
);
end
component
;
I_
clk
:
in
std_logic
;
I_rst
:
in
std_logic
;
I_comptage
:
in
std_logic
;
O_adr
:
out
std_logic_vector
(
2
downto
0
);
O_fin
:
out
std_logic
)
;
end
component
compteur_valid
;
component
comparateur
is
port
(
reg0
,
reg1
,
reg2
,
reg3
,
reg4
:
in
std_logic_vector
(
5
downto
0
);
nombre_courant
:
in
std_logic_vector
(
5
downto
0
);
invalide
:
out
std_logic
);
end
component
;
I_reg0
:
in
std_logic_vector
(
5
downto
0
);
I_reg1
:
in
std_logic_vector
(
5
downto
0
);
I_reg2
:
in
std_logic_vector
(
5
downto
0
);
I_reg3
:
in
std_logic_vector
(
5
downto
0
);
I_reg4
:
in
std_logic_vector
(
5
downto
0
);
I_nombre_courant
:
in
std_logic_vector
(
5
downto
0
);
O_invalide
:
out
std_logic
);
end
component
comparateur
;
component
compteur1_49
is
port
(
clk
,
rst
,
comptage
:
in
std_logic
;
sortie
:
out
std_logic_vector
(
5
downto
0
)
);
end
component
;
I_clk
:
in
std_logic
;
I_rst
:
in
std_logic
;
I_comptage
:
in
std_logic
;
O_sortie
:
out
std_logic_vector
(
5
downto
0
));
end
component
compteur1_49
;
component
led_pwm
is
port
(
clk
,
rst
:
in
std_logic
;
ledR
,
ledV
:
in
std_logic
;
ledR_PWM
,
ledV_PWM
:
out
std_logic
port
(
I_clk
:
in
std_logic
;
I_rst
:
in
std_logic
;
I_ledR
:
in
std_logic
;
I_ledV
:
in
std_logic
;
O_ledR_PWM
:
out
std_logic
;
O_ledV_PWM
:
out
std_logic
);
end
component
led_pwm
;
signal
recom
,
comptage
:
std_logic
;
signal
enregistrement
,
invalide
,
fin
:
std_logic
;
signal
adr
:
std_logic_vector
(
2
downto
0
);
signal
numero_courant
,
r0
,
r1
,
r2
,
r3
,
r4
,
r5
:
std_logic_vector
(
5
downto
0
);
signal
l_V
,
l_R
:
std_logic
;
signal
cpt_leds
,
cpt_leds_reg
:
unsigned
(
4
downto
0
);
signal
SC_recom
:
std_logic
;
signal
SC_comptage
:
std_logic
;
signal
SC_enregistrement
:
std_logic
;
signal
SC_invalide
:
std_logic
;
signal
SC_fin
:
std_logic
;
signal
SC_adr
:
std_logic_vector
(
2
downto
0
);
signal
SC_numero_courant
:
std_logic_vector
(
5
downto
0
);
signal
SC_r0
:
std_logic_vector
(
5
downto
0
);
signal
SC_r1
:
std_logic_vector
(
5
downto
0
);
signal
SC_r2
:
std_logic_vector
(
5
downto
0
);
signal
SC_r3
:
std_logic_vector
(
5
downto
0
);
signal
SC_r4
:
std_logic_vector
(
5
downto
0
);
signal
SC_r5
:
std_logic_vector
(
5
downto
0
);
signal
SC_l_V
:
std_logic
;
signal
SC_l_R
:
std_logic
;
signal
SC_cpt_leds
:
unsigned
(
4
downto
0
);
signal
SC_cpt_leds_reg
:
unsigned
(
4
downto
0
);
begin
automate_1
:
entity
work
.
automate
port
map
(
rst
=>
rst
,
clk
=>
clk
,
clk_display
=>
clk_display
,
bouton
=>
bouton
,
invalide
=>
invalide
,
fin
=>
fin
,
comptage
=>
comptage
,
enregistrement
=>
enregistrement
,
l_rouge
=>
l_R
,
l_verte
=>
l_V
I_
rst
=>
I_
rst
,
I_
clk
=>
I_
clk
,
I_
clk_display
=>
I_
clk_display
,
bouton
=>
I_
bouton
,
invalide
=>
SC_
invalide
,
fin
=>
SC_
fin
,
comptage
=>
SC_
comptage
,
enregistrement
=>
SC_
enregistrement
,
l_rouge
=>
SC_
l_R
,
l_verte
=>
SC_
l_V
);
registres_1
:
entity
work
.
registres
registres_2
:
entity
work
.
registres
port
map
(
clk
=>
clk
,
rst
=>
rst
,
enregistre
=>
enregistrement
,
adr
=>
adr
,
numero_courant
=>
numero_courant
,
reg0
=>
r
0
,
reg1
=>
r
1
,
reg2
=>
r
2
,
reg3
=>
r
3
,
reg4
=>
r
4
,
reg5
=>
r
5
I_
clk
=>
I_
clk
,
I_
rst
=>
I_
rst
,
I_wr
=>
SC_
enregistrement
,
I_
adr
=>
SC_
adr
,
I_data
=>
SC_
numero_courant
,
O_
reg0
=>
O_Reg
0
,
O_
reg1
=>
O_Reg
1
,
O_
reg2
=>
O_Reg
2
,
O_
reg3
=>
O_Reg
3
,
O_
reg4
=>
O_Reg
4
,
O_
reg5
=>
O_Reg
5
);
compteur_valid_1
:
entity
work
.
compteur_valid
port
map
(
clk
=>
clk
,
rst
=>
rst
,
comptage
=>
enregistrement
,
adr
=>
adr
,
fin
=>
fin
I_
clk
=>
I_
clk
,
I_
rst
=>
I_
rst
,
I_
comptage
=>
SC_
enregistrement
,
O_
adr
=>
SC_
adr
,
O_
fin
=>
SC_
fin
);
comparateur_1
:
entity
work
.
comparateur
port
map
(
reg0
=>
r0
,
reg1
=>
r1
,
reg2
=>
r2
,
reg3
=>
r3
,
reg4
=>
r4
,
nombre_courant
=>
numero_courant
,
invalide
=>
invalide
);
compteur_1
:
entity
work
.
compteur1_49
port
map
(
clk
=>
clk
,
rst
=>
rst
,
comptage
=>
comptage
,
sortie
=>
numero_courant
I_
clk
=>
I_
clk
,
I_
rst
=>
I_
rst
,
I_
comptage
=>
SC_
comptage
,
O_
sortie
=>
SC_
numero_courant
);
led_pwm_1
:
entity
work
.
led_pwm
port
map
(
clk
=>
clk
,
rst
=>
rst
,
ledR
=>
l_R
,
ledV
=>
l_V
,
ledR_PWM
=>
l_rouge
,
ledV_PWM
=>
l_verte
I_
clk
=>
I_
clk
,
I_
rst
=>
I_
rst
,
I_
ledR
=>
SC_
l_R
,
I_
ledV
=>
SC_
l_V
,
O_
ledR_PWM
=>
O_
l_rouge
,
O_
ledV_PWM
=>
O_
l_verte
);
invalide
<=
'1'
when
(
SC_reg0
=
SC_nombre_courant
or
SC_reg1
=
SC_nombre_courant
or
SC_reg2
=
SC_nombre_courant
or
SC_reg3
=
SC_nombre_courant
or
SC_reg4
=
SC_nombre_courant
)
else
'0'
;
reg0
<=
r0
;
reg1
<=
r1
;
reg2
<=
r2
;
reg3
<=
r3
;
reg4
<=
r4
;
reg5
<=
r5
;
end
a_tirage
;
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