The Lambda Lab
/
projects
/
jars.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b6d6c86
)
Default instr is now a hard-coded constant.
author
plugd
<plugd@thelambdalab.xyz>
Sat, 28 Dec 2019 22:10:26 +0000
(09:10 +1100)
committer
plugd
<plugd@thelambdalab.xyz>
Sat, 28 Dec 2019 22:10:26 +0000
(09:10 +1100)
mars.scm
patch
|
blob
|
history
run-mars.scm
patch
|
blob
|
history
diff --git
a/mars.scm
b/mars.scm
index
3ead51f
..
e97d2ba
100644
(file)
--- a/
mars.scm
+++ b/
mars.scm
@@
-79,7
+79,9
@@
;;; Memory setup and addressing
;;
;;; Memory setup and addressing
;;
- (define (make-core core-size initial-instr . set-functions)
+ (define INITIAL-INSTR (make-instr 'DAT 'F 'immediate 0 'immediate 0))
+
+ (define (make-core core-size . set-functions)
(let ((core-vec (make-vector core-size '()))
(names-vec (make-vector core-size '())))
(define (norm-addr i)
(let ((core-vec (make-vector core-size '()))
(names-vec (make-vector core-size '())))
(define (norm-addr i)
@@
-105,7
+107,7
@@
(print))
(let loop ((i 0))
(unless (>= i core-size)
(print))
(let loop ((i 0))
(unless (>= i core-size)
- (vector-set! core-vec i (
initial-instr
'make-copy))
+ (vector-set! core-vec i (
INITIAL-INSTR
'make-copy))
(loop (+ i 1))))
(lambda args
(match args
(loop (+ i 1))))
(lambda args
(match args
diff --git
a/run-mars.scm
b/run-mars.scm
index
7919e4d
..
db5a8b5
100644
(file)
--- a/
run-mars.scm
+++ b/
run-mars.scm
@@
-24,14
+24,13
@@
(lambda (fname)
(string->prog (with-input-from-file fname read-string)))
files))
(lambda (fname)
(string->prog (with-input-from-file fname read-string)))
files))
- (empty-instr (make-instr 'DAT 'F 'immediate 0 'immediate 0))
(core (if visualization
(let* ((colors '("red" "blue" "green" "magenta" "cyan"))
(color-map (make-color-map progs colors))
(vis (make-vis 640 480 core-size color-map)))
(core (if visualization
(let* ((colors '("red" "blue" "green" "magenta" "cyan"))
(color-map (make-color-map progs colors))
(vis (make-vis 640 480 core-size color-map)))
- (make-core 8000
empty-instr
(lambda (i n)
-
(vis 'update-owner i n))))
- (make-core 8000
empty-instr
)))
+ (make-core 8000 (lambda (i n)
+ (vis 'update-owner i n))))
+ (make-core 8000)))
(queues (run-mars core (install-progs core progs) iters)))
(for-each (lambda (q)
(print)
(queues (run-mars core (install-progs core progs) iters)))
(for-each (lambda (q)
(print)