2019-04-17 18:00:23 +08:00
|
|
|
from write_fasm import *
|
|
|
|
from simple_config import K
|
|
|
|
|
|
|
|
# Need to tell FASM generator how to write parameters
|
|
|
|
# (celltype, parameter) -> ParameterConfig
|
|
|
|
param_map = {
|
|
|
|
("GENERIC_SLICE", "K"): ParameterConfig(write=False),
|
|
|
|
("GENERIC_SLICE", "INIT"): ParameterConfig(write=True, numeric=True, width=2**K),
|
2019-11-09 00:15:12 +08:00
|
|
|
("GENERIC_SLICE", "FF_USED"): ParameterConfig(write=True, numeric=True, width=1),
|
2019-04-17 18:00:23 +08:00
|
|
|
|
|
|
|
("GENERIC_IOB", "INPUT_USED"): ParameterConfig(write=True, numeric=True, width=1),
|
|
|
|
("GENERIC_IOB", "OUTPUT_USED"): ParameterConfig(write=True, numeric=True, width=1),
|
|
|
|
("GENERIC_IOB", "ENABLE_USED"): ParameterConfig(write=True, numeric=True, width=1),
|
|
|
|
}
|
|
|
|
|
|
|
|
with open("blinky.fasm", "w") as f:
|
2019-11-08 22:54:27 +08:00
|
|
|
write_fasm(ctx, param_map, f)
|