Exemplo n.º 1
0
            public void SetOutputs(StallControlTestOutput expected)
            {
                var members = RTLReflectionTools.RecursiveMembers(expected.GetType());

                foreach (var m in members)
                {
                    var signalValue = m.GetValue(expected);

                    if (!signalAsserts.ContainsKey(m.Name))
                    {
                        signalAsserts[m.Name] = new List <SignalAssert>();
                    }

                    var at = offset + (currentClock) * clockDuration + 1000;

                    switch (signalValue)
                    {
                    case bool v:
                        signalAsserts[m.Name].Add(new SignalAssert()
                        {
                            value = new RTLBitArray(v), at = at
                        });
                        break;

                    case byte b:
                        signalAsserts[m.Name].Add(new SignalAssert()
                        {
                            value = new RTLBitArray(b), at = at
                        });
                        break;
                    }
                }
            }
Exemplo n.º 2
0
            public void setInputs(StallControlTestPipelineModuleInputs inputs)
            {
                var members = RTLReflectionTools.RecursiveMembers(inputs.GetType());

                foreach (var m in members)
                {
                    var signalValue = (bool)m.GetValue(inputs);

                    if (!signalsValues.ContainsKey(m.Name))
                    {
                        signalsValues[m.Name] = new List <SignalValue>()
                        {
                            new SignalValue()
                            {
                                value = signalValue, duration = offset
                            }
                        };
                    }
                    else
                    {
                        var list      = signalsValues[m.Name];
                        var lastValue = list.Last();
                        if (lastValue.value != signalValue)
                        {
                            list.Add(new SignalValue()
                            {
                                value = signalValue, duration = clockDuration
                            });
                        }
                        else
                        {
                            lastValue.duration += clockDuration;
                        }
                    }
                }
            }