Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin Aristote
Microprocessor
Commits
354b51a2
Commit
354b51a2
authored
Mar 04, 2019
by
Quentin Aristote
Browse files
added missing files
parent
36d0884b
Changes
4
Hide whitespace changes
Inline
Side-by-side
clock/command.rom
0 → 100644
View file @
354b51a2
File added
clock/horloge.asm
0 → 100644
View file @
354b51a2
#
_____________________________________
#
|
|
#
|
Programme
assembleur
pour
l
'
horloge
|
#
|
_____________________________________
|
#
#
On
suppose
que
les
registres
suivants
sont
d
é
j
à
initialis
é
s
comme
#
explicit
é
:
#
$t0
:
seconde
(
s
)
(
0
->
59
)
#
$t1
:
minute
(
min
)
(
0
->
59
)
#
$t2
:
heure
(
h
)
(
0
->
23
)
#
$t3
:
jour
(
j
)
(
1
->
30
)
#
$t4
:
mois
(
m
)
(
1
->
12
)
#
$t5
:
ann
é
e
(
a
)
(
0
->
2
^
31
-
1
)
#
$t6
:
groupe
de
travailleurs
(
t
)
(
0
->
5
)
#
$t7
:
jour
f
é
ri
é
(
f
)
(
0
->
6
)
#
Le
calendrier
r
é
volutionnaire
sovi
é
tique
fonctionne
ainsi
:
#
Chaque
mois
compte
30
jours
,
et
les
cinq
ou
si
x
jours
restants
sont
#
ajout
é
s
comme
jours
interm
é
di
aires
de
cong
é
(
f
é
ri
é
s
),
n
'
appartenant
à
#
aucun
des
12
mois
et
à
aucune
semaine.
Ces
jours
sont
:
#
le
jour
de
L
é
nine
,
apr
è
s
le
30
janvier
(
$
t7
=
1
)
;
#
deux
jours
du
travail
,
apr
è
s
le
30
avril
(
$
t7
=
2
,
3
)
;
#
deux
jours
de
l
'
industrie
,
apr
è
s
le
7
novembre
$
(
t7
=
4
,
5
)
;
#
les
ann
é
es
bissextiles
,
un
jour
suppl
é
mentaire
apr
è
s
le
30
#
f
é
vrier
(
$
t7
=
6
)
.
main
:
#
s
!=
59
?
addi
$
s0
,
$
t0
,
-
59
#
si
oui
,
on
incr
é
mente
seulement
la
seconde
bltz
$
s0
,
not_last_second
#
sinon
,
on
es
saie
d
'
incr
é
menter
la
minute
lui
$
t0
,
0
#
s
=
0
#
min
!=
59
?
addi
$
s0
,
$
t1
,
-
59
#
si
oui
,
on
incr
é
mente
seulement
la
minute
bltz
$
s0
,
not_last_minute
#
sinon
,
on
es
saie
d
'
incr
é
menter
l
'
heure
lui
$
t1
,
0
#
min
=
0
#
h
!=
23
?
addi
$
s0
,
$
t2
,
-
23
#
si
oui
,
on
incr
é
mente
seulement
l
'
heure
bltz
$
s0
,
not_last_hour
#
si
non
,
on
es
saie
d
'
incr
é
menter
le
jour
lui
$
t2
,
0
#
h
=
0
#
j
!=
0
?
#
si
oui
,
le
jour
n
'
es
t
pas
f
é
ri
é
bne
$
t3
,
$
zero
,
not_rest_day
#
sinon
,
le
jour
es
t
f
é
ri
é
et
on
lui
accorde
#
un
traitement
particuluier
#
f
=
2
(
1
er
jour
des
travailleurs
)
?
lui
$
s0
,
2
beq
$
s0
,
$
t7
,
first_workers_day
j
not_first_workers_day
first_workers_day
:
#
si
oui
,
on
es
t
d
é
sormais
le
2
nd
jour
des
travailleurs
lui
$
t7
,
3
j
end
not_first_workers_day
:
#
f
=
4
(
1
er
jour
de
l
'
industrie
)
?
lui
$
s0
,
4
beq
$
s0
,
$
t7
,
first_industry_day
j
not_first_industry_day
first_industry_day
:
#
si
oui
,
on
es
t
d
é
sormais
le
2
nd
jour
de
l
'
industrie
lui
$
t7
,
5
j
end
not_first_industry_day
:
#
f
=
5
(
2
nd
jour
de
l
'
industrie
)
?
lui
$
s0
,
5
beq
$
s0
,
$
t7
,
second_industry_day
j
not_second_industry_day
second_industry_day
:
#
si
oui
,
on
es
t
d
é
sormais
le
8
novembre
lui
$
t7
,
0
lui
$
t3
,
8
lui
$
t6
,
3
j
end
not_second_industry_day
:
#
sinon
on
es
t
d
é
sormais
forc
é
ment
le
1
er
du
mois
suivant
lui
$
t7
,
0
lui
$
t3
,
1
lui
$
t6
,
1
addi
$
t4
,
$
t4
,
1
#
on
n
'é
tait
pas
en
d
é
cembre
j
end
not_rest_day
:
#
le
jour
n
'
es
t
pas
f
é
ri
é
#
est
-
on
le
7
novembre
?
#
j
!=
7
?
lui
$
s0
,
7
bne
$
t3
,
$
s0
,
not_november_7th
#
m
!=
11
?
lui
$
s0
,
11
bne
$
t4
,
$
s0
,
not_november_7th
#
si
oui
,
on
es
t
maintenant
le
1
er
jour
de
l
'
industrie
#
et
on
es
t
notamment
un
jour
f
é
ri
é
lui
$
t7
,
4
j
now_rest_day
not_november_7th
:
#
on
n
'
es
t
pas
le
7
novembre
#
j
!=
30
?
lui
$
s0
,
30
#
si
oui
,
on
peut
incr
é
menter
le
jour
bne
$
s0
,
$
t3
,
not_last_day
#
sinon
,
il
faut
d
é
terminer
si
le
lendemain
es
t
f
é
ri
é
#
m
=
1
?
lui
$
s0
,
1
beq
$
s0
,
$
t4
,
january_30th
j
not_january_30th
january_30th
:
#
si
oui
,
on
es
t
maintenant
le
jour
de
L
é
nine
lui
$
t7
,
1
j
now_rest_day
not_january_30th
:
#
m
=
4
?
lui
$
s0
,
4
beq
$
s0
,
$
t4
,
april_30th
j
not_april_30th
april_30th
:
#
si
oui
,
on
es
t
maintenant
le
1
er
jour
des
travailleurs
lui
$
t7
,
2
j
now_rest_day
not_april_30th
:
#
m
=
2
?
lui
$
s0
,
2
beq
$
s0
,
$
t4
,
february_30th
j
not_bissextile_february_30th
february_30th
:
#
ann
é
e
bissextile
?
#
on
calcule
$
t5
mod
4
en
lui
#
enlevant
4
*
$
t5
/
4
(
di
vision
eucluidienne
)
srl
$
s0
,
$
t5
,
2
sll
$
s0
,
$
s0
,
2
beq
$
s0
,
$
t5
,
bissextile_february_3Oth
j
not_bissextile_february_30th
bissextile_february_30th
:
#
si
oui
,
on
es
t
maintenant
#
le
jour
f
é
ri
é
des
ann
é
es
bissextiles
lui
$
t7
,
6
j
now_rest_day
not_bissextile_february_30th
:
#
on
es
t
le
30
mais
pas
la
veille
d
'
un
jour
f
é
ri
é
lui
$
t3
,
1
#
m
!=
12
?
lui
$
s0
,
12
bne
$
s0
,
$
t4
,
not_last_day_of_year
j
last_day_of_year
not_last_day_of_year
:
#
si
oui
,
on
incr
é
mente
seulement
le
mois
addi
$
t4
,
$
t4
,
1
j
end
last_day_of_year
:
#
sinon
,
on
incr
é
mente
l
'
ann
é
e
et
on
remet
le
mois
à
1
addi
$
t5
,
$
t5
,
1
lui
$
t4
,
1
j
end
not_last_second
:
#
s
<
59
addi
$
t0
,
$
t0
,
1
#
s
++
j
end
not_last_minute
:
#
s
=
59
&
min
<
59
addi
$
t1
,
$
t1
,
1
#
min
++
j
end
not_last_hour
:
#
min
=
59
&
h
<
23
addi
$
t2
,
$
t2
,
1
#
h
++
j
end
not_last_day
:
#
h
=
23
&
j
<
30
addi
$
t3
,
$
t3
,
1
#
j
++
#
t
=
5
?
lui
$
s0
,
5
beq
$
s0
,
$
t6
,
last_day_of_week
j
not_last_day_of_week
last_day_of_week
:
lui
$
t6
,
1
#
t
=
1
j
end
not_last_day_of_week
:
addi
$
t6
,
$
t6
,
1
#
t
++
j
end
now_rest_day
:
#
on
es
t
d
é
sormais
un
jour
f
é
ri
é
lui
$
t3
,
0
#
j
=
0
lui
$
t6
,
0
#
t
=
0
end
:
netlist-simulator/graph.ml
View file @
354b51a2
...
...
@@ -37,14 +37,15 @@ let find_roots g =
let
topological
g
=
clear_marks
g
;
let
l
=
ref
[]
in
let
rec
parcours
nodes
=
List
.
iter
(
fun
n
->
if
n
.
n_mark
=
InProgress
then
raise
Has_cycle
else
if
(
n
.
n_mark
=
NotVisited
)
then
(
n
.
n_mark
<-
InProgress
;
parcours
n
.
n_link_to
;
l
:=
n
.
n_label
::
!
l
;
n
.
n_mark
<-
Visited
)
)
nodes
let
rec
parcours
nodes
=
List
.
iter
(
fun
n
->
if
n
.
n_mark
=
InProgress
then
raise
Has_cycle
else
if
n
.
n_mark
=
NotVisited
then
(
n
.
n_mark
<-
InProgress
;
parcours
n
.
n_link_to
;
l
:=
n
.
n_label
::
!
l
;
n
.
n_mark
<-
Visited
))
nodes
in
parcours
g
.
g_nodes
;
!
l
!
l
netlist-simulator/scheduler.ml
View file @
354b51a2
...
...
@@ -50,17 +50,16 @@ let schedule p =
add_var
a
|
Eselect
(
_
,
a
)
->
add_var
a
)
p
.
p_eqs
;
if
has_cycle
vars
then
raise
Combinational_cycle
else
p
.
p_eqs
;
let
rec
gen_eqs
=
function
|
[]
->
[]
|
t
::
q
->
try
(
t
,
List
.
assoc
t
p
.
p_eqs
)
::
(
gen_eqs
q
)
with
|
Not_found
->
gen_eqs
q
in
{
p_eqs
=
gen_eqs
(
topological
vars
);
p_inputs
=
p
.
p_inputs
;
p_outputs
=
p
.
p_outputs
;
p_vars
=
p
.
p_vars
}
try
{
p_eqs
=
gen_eqs
(
topological
vars
);
p_inputs
=
p
.
p_inputs
;
p_outputs
=
p
.
p_outputs
;
p_vars
=
p
.
p_vars
}
with
Has_cycle
->
raise
Combinational_cycle
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment