Пример #1
0
        void BuildAndRunSim(string testbench)
        {
            var tcl = new VivadoTCL();

            tcl
            .create_project("test", part: "xa7s6cpga196-2I", verbose: true)
            .SetProperty("target_language", "Verilog", tcl.CurrentProject)
            .AddSources(TestSourceFolder, "*.v")
            .update_compile_order(fileset: "sources_1")
            .SetProperty("top", "top", tcl.CurrentFileSet)
            .SetProperty("top", testbench, tcl.Sim1)
            .SetProperty("SOURCE_SET", "sources_1", tcl.Sim1)
            .SetProperty("RUNTIME", "0ns", tcl.Sim1)
            .launch_runs("impl_1", jobs: 4)
            .wait_on_run("impl_1")
            .launch_simulation(mode: launch_simulation_mode.post_implementation, type: launch_simulation_type.timing)
            .restart()
            .open_vcd(file_name: Path.Combine(TestOutputFolder, "sim.vcd"))
            .log_vcd(hdl_objects: "*")
            .run(time: "1000", unit: "ns")
            .flush_vcd()
            .close_vcd()
            .close_sim()
            ;

            RunTCL(tcl);
        }
Пример #2
0
        public void FlatTCL_CreateProject()
        {
            var tcl = new VivadoTCL();

            tcl.create_project("test", verbose: true);
            SaveTCL(tcl);
            Assert.AreEqual("create_project -verbose test", LoadTCLLines()[0]);
        }
Пример #3
0
        public void FlatTCL_Custom_CreateProject()
        {
            var tcl = new VivadoTCL(new CustomVivadoTCLBuilder());

            tcl.create_project("test");
            SaveTCL(tcl);
            Assert.AreEqual("create_project -verbose test", LoadTCLLines()[0]);
        }
Пример #4
0
        protected void RunVivadoSimulator()
        {
            var snapshot = _simulator.Snapshot;
            var duration = 500 * 2 * (snapshot.Clock + 1);

            var tcl = new VivadoTCL();

            tcl
            .create_project("test", part: "xa7s6cpga196-2I", verbose: true)
            .SetProperty("target_language", "Verilog", tcl.CurrentProject)
            .AddSources(hdlPath, "*.v")
            .update_compile_order(fileset: "sources_1")
            .SetProperty("top", topLevelModule, tcl.CurrentFileSet)
            .SetProperty("top", testbenchName, tcl.Sim1)
            .SetProperty("SOURCE_SET", "sources_1", tcl.Sim1)
            .SetProperty("RUNTIME", "0ns", tcl.Sim1)
            .launch_runs("impl_1", jobs: 4)
            .wait_on_run("impl_1")
            .launch_simulation(
                mode: launch_simulation_mode.post_implementation,
                type: launch_simulation_type.timing)
            .restart()
            .open_vcd(file_name: VCDFile)
            .log_vcd(hdl_objects: "*")
            .run(
                time: $"{duration}",
                unit: "ns")
            .flush_vcd()
            .close_vcd()
            .close_sim()
            ;

            var va = new VivadoAdapter(VivadoProjectLocation);

            va.CleanupVivado();
            va.SaveTCL(tcl);
            va.RunScript();
        }