Function to generate Timeseries file to use for Moore FSM coverage analysis.

by

 

This function generates a Timeseries file which can be used for Moore FSM coverage analysis.

generatetestdata(i)
function [] = generatetestdata(i)
    if (i < 1 || i > 24)
        disp('    The input argument is out of range.')
        return
    end
    k = 0;  m = 1;  g = 2;
    Temp = false(2^i,i);
    while (m <= i)
        while (g <= 2^i)
            for (k = 0 : 2^(m-1)-1)
                Temp(g+k,i-m+1) = true;
                k = k+1;
            end
            g = g+2^m;
        end
        g = 2^m+1;
        m = m+1;
    end
    Data = Temp;
    Data = rot90(Data);
    Data = rot90(Data);
    Data = [Temp;Data];
    Time = ones(2*2^i,1);
    g = 2;
    while (g <= 2*2^i)
        Time(g) = Time(g-1)+1;
        g = g+1;
    end
    Test_Data = timeseries(Data,Time);
    Test_Data.DataInfo.Units = 'boolean';
    Test_Data.Name = 'Test_Data';
    save('Test_Data.mat','Test_Data','-v7.3');
end

Contact us