From f413355d05cade14dae3838c786de181fc31b251 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 26 Jun 2016 15:34:40 +0200 Subject: [PATCH] updated the configuration --- config.h | 5 ++- etc/fpga.conf | 101 +++++++++++++++++++++++++++++++++++--------------- lib/cfg.c | 25 ++++++++++--- 3 files changed, 94 insertions(+), 37 deletions(-) diff --git a/config.h b/config.h index 979a4d782..9d6424367 100644 --- a/config.h +++ b/config.h @@ -20,7 +20,10 @@ /** The version number of VILLASnode */ #define VERSION "v0.5-" _GIT_REV -/** Default number of values in a message */ +#define DEFAULT_PRIORITY 80 +#define DEFAULT_AFFINITY -1 + +/** Default number of values in a sample */ #define DEFAULT_VALUES 64 #define DEFAULT_QUEUELEN 1024 diff --git a/etc/fpga.conf b/etc/fpga.conf index 18728c56c..433be49cd 100644 --- a/etc/fpga.conf +++ b/etc/fpga.conf @@ -1,3 +1,8 @@ +affinity = 0xC; + +debug = 0; + +stats = 1; fpga = { /* Card identification */ @@ -20,14 +25,6 @@ fpga = { baseaddr = 0x0000; size = 0x2000; }, - xsg_multiply_0 = { - vlnv = "acs.eonerc.rwth-aachen.de:sysgen:xsg_multiply:1.0"; - baseaddr = 0x2000; - port = 4; - parameters = { - factor = 2.0; - } - }, dma_0 = { vlnv = "xilinx.com:ip:axi_dma:7.1"; baseaddr = 0x3000; @@ -37,12 +34,12 @@ fpga = { timer_0 = { vlnv = "xilinx.com:ip:axi_timer:2.0"; baseaddr = 0x4000; - irq = 0; /* 0 - 1 */ + irq = 0; }, switch_0 = { vlnv = "xilinx.com:ip:axis_interconnect:2.1" baseaddr = 0x5000; - numports = 10; + num_ports = 10; }, fifo_mm_s_0 = { vlnv = "xilinx.com:ip:axi_fifo_mm_s:4.1"; @@ -54,29 +51,37 @@ fpga = { rtds_axis_0 = { vlnv = "acs.eonerc.rwth-aachen.de:user:rtds_axis:1.0"; baseaddr = 0x8000; - port = 5; + port = 0; irq = 5; /* 5 -7 */ - }, - hls_multiply_0 = { - vlnv = "acs.eonerc.rwth-aachen.de:hls:hls_multiply:1.1"; - baseaddr = 0x9000; - port = 5; + + inputs = { + in = "axis_interconnect:0" + }, + outputs = { + out = "axis_interconnect:0", + }; + irqs = { + ts = "axi_pcie_intc_0:5", + ovfl = "axi_pcie_intc_0:6", + case = "axi_pcie_intc_0:7", + } }, dma_1 = { vlnv = "xilinx.com:ip:axi_dma:7.1"; - baseaddr = 0xA000; - port = 7; + baseaddr = 0x2000; + port = 6; irq = 3; /* 3 - 4 */ }, - hls_decimate_0 = { - vlnv = "acs.eonerc.rwth-aachen.de:hls:hls_decimate:1.0"; - baseaddr = 0xE000; - port = 8; - }, hls_dft_0 = { vlnv = "acs.eonerc.rwth-aachen.de:hls:hls_dft:1.0"; - baseaddr = 0xF000; - port = 9; + baseaddr = 0x9000; + port = 5; + irq = 1; + + period = 400; /* in samples: 20ms / 50uS = 400*/ + harmonics = [ 0, 1, 3, 5, 7 ] + decimation = 1; /* 0 = disabled */ + //harmonics = [ 0, 1, 2, 5, 22 ] }, axis_data_fifo_0 = { vlnv = "xilinx.com:ip:axis_data_fifo:1.1"; @@ -90,8 +95,22 @@ fpga = { /* Configure switch */ paths = ( - { in = "dma", out = "hls_dft" }, - { in = "hls_dft", out = "dma" } +// DM Tests +// { in = "fifo_mm_s_0", out = "fifo_mm_s_0" }, +// { in = "dma_1", out = "dma_1" }, +// { in = "dma_0", out = "dma_0" } + +// DFT <-> RTDS +// { in = "rtds_axis_0", out = "hls_dft_0" }, +// { in = "hls_dft_0", out = "rtds_axis_0" } + +// Linux <-> RTDS +// { in = "rtds_axis_0", out = "dma_1" }, +// { in = "dma_1", out = "rtds_axis_0" } + +// DFT <-> Linux + { in = "dma_0", out = "hls_dft_0" }, + { in = "hls_dft_0", out = "dma_0" } ) } @@ -100,9 +119,31 @@ plugins = [ ] nodes = { - dma = { + dma_0 = { + type = "fpga"; datamover = "dma_0"; - use_irqs = false; + }, + dma_1 = { + type = "fpga"; + datamover = "dma_1"; + }, + fifo_0 = { + type = "fpga"; + datamover = "fifo_mm_s_0"; + use_irqs = true + }, + simple_circuit = { + type = "cbuilder"; + model = "simple_circuit", + timestep = 25e-6; + parameters = [ + 1.0, /**< R2 = 1 Ohm */ + 0.001 /**< C2 = 1000 uF */ + ]; } +} -} \ No newline at end of file +paths = ( +// { in = "dma_1", out = "dma_1" }, + { in = "dma_1", out = "simple_circuit", reverse = true } +) diff --git a/lib/cfg.c b/lib/cfg.c index 06a268de9..ec3715441 100644 --- a/lib/cfg.c +++ b/lib/cfg.c @@ -26,12 +26,13 @@ int config_parse(const char *filename, config_t *cfg, struct settings *set, filename_cpy = strdup(filename); include_dir = dirname(filename_cpy); - free(filename_cpy); /* Setup libconfig */ config_set_auto_convert(cfg, 1); config_set_include_dir(cfg, include_dir); + free(filename_cpy); + ret = strcmp("-", filename) ? config_read_file(cfg, filename) : config_read(cfg, stdin); if (ret != CONFIG_TRUE) { error("Failed to parse configuration: %s in %s:%d", @@ -80,8 +81,14 @@ int config_parse(const char *filename, config_t *cfg, struct settings *set, int config_parse_global(config_setting_t *cfg, struct settings *set) { - config_setting_lookup_int(cfg, "affinity", &set->affinity); - config_setting_lookup_int(cfg, "priority", &set->priority); + config_setting_t *cfg_plugins; + + if (!config_setting_lookup_int(cfg, "affinity", &set->affinity)) + set->affinity = DEFAULT_AFFINITY; + + if (!config_setting_lookup_int(cfg, "priority", &set->priority)) + set->priority = DEFAULT_PRIORITY; + config_setting_lookup_int(cfg, "debug", &set->debug); config_setting_lookup_float(cfg, "stats", &set->stats); @@ -123,7 +130,10 @@ int config_parse_path(config_setting_t *cfg, path_init(p); /* Input node */ - if (!config_setting_lookup_string(cfg, "in", &in)) + if (!config_setting_lookup_string(cfg, "in", &in) && + !config_setting_lookup_string(cfg, "from", &in) && + !config_setting_lookup_string(cfg, "src", &in) && + !config_setting_lookup_string(cfg, "source", &in)) cerror(cfg, "Missing input node for path"); p->in = list_lookup(nodes, in); @@ -131,8 +141,11 @@ int config_parse_path(config_setting_t *cfg, cerror(cfg, "Invalid input node '%s'", in); /* Output node(s) */ - cfg_out = config_setting_get_member(cfg, "out"); - if (!cfg_out) + if (!(cfg_out = config_setting_get_member(cfg, "out")) && + !(cfg_out = config_setting_get_member(cfg, "to")) && + !(cfg_out = config_setting_get_member(cfg, "dst")) && + !(cfg_out = config_setting_get_member(cfg, "dest")) && + !(cfg_out = config_setting_get_member(cfg, "sink"))) cerror(cfg, "Missing output nodes for path"); ret = config_parse_nodelist(cfg_out, &p->destinations, nodes);