1
0
Fork 0

add simple ARTIQ kernel

This commit is contained in:
Sebastien Bourdeauducq 2020-04-12 09:45:52 +08:00
parent ab1dff4c48
commit 1d7914a20a
4 changed files with 54 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
build/ build/
runtime/src/pl.rs runtime/src/pl.rs
target/ target/
__pycache__

14
examples/blink_forever.py Normal file
View File

@ -0,0 +1,14 @@
from artiq.experiment import *
class BlinkForever(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("led0")
@kernel
def run(self):
self.core.reset()
while True:
self.led0.pulse(100*ms)
delay(100*ms)

38
examples/device_db.py Normal file
View File

@ -0,0 +1,38 @@
device_db = {
"core": {
"type": "local",
"module": "artiq.coredevice.core",
"class": "Core",
"arguments": {
"host": "192.168.1.52",
"ref_period": 1e-9,
"ref_multiplier": 1,
"target": "cortexa9"
}
},
"led0": {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0},
},
"led1": {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 1},
},
"led2": {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 2}
},
"led3": {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLInOut",
"arguments": {"channel": 3}
},
}

View File

@ -36,12 +36,12 @@ in
rustcSrc rustcSrc
pkgs.cargo-xbuild pkgs.cargo-xbuild
pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc
pkgs.openocd pkgs.openocd
pkgs.gdb pkgs.gdb
(pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc artiq ]))) (pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc artiq ])))
vivado vivado
artiqpkgs.binutils-arm
]; ];
XARGO_RUST_SRC = "${rustcSrc}/src"; XARGO_RUST_SRC = "${rustcSrc}/src";