Beispiel #1
0
        public static void Run()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            GenTestData();

            Signal <float> in_real    = new Signal <float>();
            Signal <float> in_imag    = new Signal <float>();
            Signal <bool>  data_valid = new Signal <bool>();
            Signal <bool>  data_ack   = new Signal <bool>();
            Signal <float> out_real   = new Signal <float>();
            Signal <float> out_imag   = new Signal <float>();
            Signal <bool>  data_req   = new Signal <bool>();
            Signal <bool>  data_ready = new Signal <bool>();
            Signal <bool>  data_fin1  = new Signal <bool>();
            Signal <bool>  data_fin2  = new Signal <bool>();
            SLSignal       clk        = new SLSignal();

            Clock cgen = new Clock(new Time(10.0, ETimeUnit.ns), 0.5)
            {
                Clk = clk
            };
            FFT fft = new FFT()
            {
                CLK          = clk,
                in_real      = in_real,
                in_imag      = in_imag,
                data_valid   = data_valid,
                data_ack     = data_ack,
                out_real     = out_real,
                out_imag     = out_imag,
                data_req     = data_req,
                data_ready   = data_ready,
                data_fin_in  = data_fin1,
                data_fin_out = data_fin2
            };
            Source source = new Source()
            {
                RealPath = "in_real.large",
                ImagPath = "in_imag.large",

                data_req   = data_req,
                out_real   = in_real,
                out_imag   = in_imag,
                data_valid = data_valid,
                data_fin   = data_fin1,
                CLK        = clk
            };
            Sink sink = new Sink()
            {
                RealPath = "out_real.large",
                ImagPath = "out_imag.large",

                data_ready = data_ready,
                data_ack   = data_ack,
                in_real    = out_real,
                in_imag    = out_imag,
                data_fin   = data_fin2,
                CLK        = clk
            };

            DesignContext.Instance.Elaborate();
            Log.Verbose = true;
            long startTicks = DateTime.Now.Ticks;

            DesignContext.Instance.Simulate(long.MaxValue);
            long   endTicks   = DateTime.Now.Ticks;
            double durationMS = (double)(endTicks - startTicks) / 10000.0;

            Console.WriteLine("Analysis took " + durationMS + "ms");
        }
Beispiel #2
0
        public static void Run()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            GenTestData();

            Signal<float> in_real = new Signal<float>();
            Signal<float> in_imag = new Signal<float>();
            Signal<bool> data_valid = new Signal<bool>();
            Signal<bool> data_ack = new Signal<bool>();
            Signal<float> out_real = new Signal<float>();
            Signal<float> out_imag = new Signal<float>();
            Signal<bool> data_req = new Signal<bool>();
            Signal<bool> data_ready = new Signal<bool>();
            Signal<bool> data_fin1 = new Signal<bool>();
            Signal<bool> data_fin2 = new Signal<bool>();
            SLSignal clk = new SLSignal();

            Clock cgen = new Clock(new Time(10.0, ETimeUnit.ns), 0.5)
            {
                Clk = clk
            };
            FFT fft = new FFT()
            {
                CLK = clk,
                in_real = in_real,
                in_imag = in_imag,
                data_valid = data_valid,
                data_ack = data_ack,
                out_real = out_real,
                out_imag = out_imag,
                data_req = data_req,
                data_ready = data_ready,
                data_fin_in = data_fin1,
                data_fin_out = data_fin2
            };
            Source source = new Source()
            {
                RealPath = "in_real.large",
                ImagPath = "in_imag.large",

                data_req = data_req,
                out_real = in_real,
                out_imag = in_imag,
                data_valid = data_valid,
                data_fin = data_fin1,
                CLK = clk
            };
            Sink sink = new Sink()
            {
                RealPath = "out_real.large",
                ImagPath = "out_imag.large",

                data_ready = data_ready,
                data_ack = data_ack,
                in_real = out_real,
                in_imag = out_imag,
                data_fin = data_fin2,
                CLK = clk
            };

            DesignContext.Instance.Elaborate();
            Log.Verbose = true;
            long startTicks = DateTime.Now.Ticks;
            DesignContext.Instance.Simulate(long.MaxValue);
            long endTicks = DateTime.Now.Ticks;
            double durationMS = (double)(endTicks - startTicks) / 10000.0;
            Console.WriteLine("Analysis took " + durationMS + "ms");
        }