Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 16 11:28
    dsvf commented #152
  • Sep 16 07:48

    chipmuenk on develop

    Update Readme Signed-off-by: ch… improve documentation Signed-of… remove unneccessary attributes … and 3 more (compare)

  • Sep 14 16:52
    chipmuenk edited #144
  • Sep 14 16:51
    chipmuenk edited #144
  • Sep 13 17:30

    chipmuenk on 0.2rc4

    (compare)

  • Sep 13 17:29

    chipmuenk on develop

    Another attempt to fix the PyPI… (compare)

  • Sep 13 17:29

    chipmuenk on master

    Correct label Signed-off-by: ch… update pyfda class diagram Sign… add fixpoint screenshots Signed… and 7 more (compare)

  • Sep 13 16:46

    chipmuenk on develop

    change to lower case Signed-off… (compare)

  • Sep 13 13:01

    chipmuenk on develop

    Fix export error Signed-off-by:… Add captions Signed-off-by: chi… (compare)

  • Sep 13 12:51

    chipmuenk on develop

    Correct label Signed-off-by: ch… update pyfda class diagram Sign… add fixpoint screenshots Signed… and 3 more (compare)

  • Sep 13 11:23

    chipmuenk on master

    Update version Signed-off-by: c… Include documentation for log c… (compare)

  • Sep 13 11:22

    chipmuenk on develop

    improve documentation, remove n… bump version Signed-off-by: chi… Try to add markdown documentati… and 4 more (compare)

  • Sep 13 11:17

    chipmuenk on master

    improve documentation, remove n… bump version Signed-off-by: chi… Try to add markdown documentati… and 2 more (compare)

  • Sep 13 09:37
    chipmuenk commented #148
  • Sep 13 09:33
    chipmuenk reopened #148
  • Sep 11 09:01

    chipmuenk on 0.2rc3

    (compare)

  • Sep 10 19:48

    chipmuenk on master

    provide a README_PYPI.rst with … bump version Signed-off-by: chi… Update fixpoint specs doc file … and 29 more (compare)

  • Sep 10 19:38

    chipmuenk on develop

    fix include path Signed-off-by:… fix path Signed-off-by: chipmue… (compare)

  • Sep 10 19:29

    chipmuenk on develop

    try to include external file Si… Merge branch 'develop' of https… (compare)

  • Sep 10 19:23

    chipmuenk on develop

    try to include external file Si… (compare)

Christopher Felton
@cfelton
the API to pyfda will be provided by these objects and they can be coded here https://github.com/cfelton/filter-blocks/tree/master/filter_blocks/fda
Christopher Felton
@cfelton
the link shows the block usage, not the FIR implementation
Christian Münker
@chipmuenk
Only had the time for a quick look: Looks clear & good, I would only suggest handling the float -> integer conversion of coefficients in pyfda so that the user can make a first estimation whether coefficient quantizations has an disastrous effect. It would also be nice if quantization parameters (e.g. accumulator wordlength and requantization method like floor, fix etc) could be controlled via the ui.
Currently, I'm developing in the branch 'hdl_interface', I've renamed the directory with the fixpoint implementations and some files and I'm in the process of redesigning where and how pyfda looks for user files at startup. Perhaps you can take a look before I merge some time next week.
Christopher Felton
@cfelton
@sriyash25 @chipmuenk we started a discussion, how to pass all the parameters to the filter-blocks
one idea is to have a class that can be used to set all the parameters
Christopher Felton
@cfelton

from ..fir import filter_fir_df

class FIRFilter(HardwareFilter):
    def __init__(self, b):
        self.filter_type = 'direct_form'
        self.n_cascades = 0

    def set_cascade(self, n_cascades):
        self.n_cascades = n_cascades

    @hdl.block
    def filter_block(self, glbl, sigin, sigout):
        # this elaboration code will select the different structure and implementations
        if self.filter_type == 'direct_form':
            if self.direct_form_type == 1:
                # all filters will need the same interface ports, this should be do able
                dfilter = filter_fir_df

            if self.n_cascades > 0:
                filter_insts = [None for _ in range(self.n_cascades)]
                for ii in range(self.n_cascades):
                    filter_insts[ii] = dfilter(
                        glbl, sigin[ii], sigout[ii]
                    )
            else:
                filter_inst = dfilter(...)
there are a lot of details missing
this api will take some experimentation to figure out
these objects would live in filter_blocks/fda/fir.py, filter_blocks/fda/iir.py etc.
Sriyash Caculo
@sriyash25
Okay, I think we can start with DF1 FIR and come to cascades later (as suggester by Christian). I will attempt to set parameters through this class and see how it goes.
Christian Münker
@chipmuenk
@cfelton I agree that organizing filters in a class or in several classes is a good approach to bundle all the functionality we need:
  • setting (and maybe getting) parameters like internal and external word formats or coefficients. I suggest a setter method with **kwargs
  • fixpoint simulation stuff
  • HDL synthesis stuff
  • maybe information on internal quanization noise on an algorithmic / behavioural level etc.
Christian Münker
@chipmuenk
I'm not sure though whether it is easier to write one class per filter implementation (given that fixpoint implementations can be very different in e.g. their parameters and simulation setup) or to create a large class.
Sriyash Caculo
@sriyash25
@chipmuenk I was under the impression that we would be creating only two classes for now, one for fir and one for iir filters. Although, even these two can be bundled into one
Christopher Felton
@cfelton
you want a hierarchy, and only create a new class based on the subclasses if one is needed
Christian Münker
@chipmuenk
I think we have reached a point where it would be best to whip up an example that we can use as a base for discussion. In pyfda, I can now easily write a dict with integer coefficients and word lengths and trigger HDL conversion.
My next step would be to think about a way for importing data from fixpoint simulation.
Christian Münker
@chipmuenk
To give some inspiration to our discussion tomorrow, here are a some screenshots from Mathworks fdatool with fixpoint toolbox:
fdatool_quant1
fdatool_quant2.png
fdatool_quant3.png
fdatool_quant3b.png
fdatool_quant3d.png
Christian Münker
@chipmuenk
And this the UI of the current pyfda development:
pyfdax_fixpoint.png
Christian Münker
@chipmuenk

I suggest the following discussion topics for tomorrow:

  • State / progress of the project

  • Import mechanism pyfda <-> myhdl

  • File / directory structure: How do we organize the myhdl and UI descriptions
  • Who you're gonna call: Communication between myhdl and pyfda
  • Interfaces for fixpoint simulations: input data, number of points, output format ...

  • Fixpoint filter implementations: next steps

  • Integration into the myhdl ecosystem
Sriyash Caculo
@sriyash25
A brief summery of the discussion
  • Import mechanism pyfda <-> myhdl
    We will have multiple classes for different filter implementations inheriting from whichever class appropriate. Base class FilterHardware.
    Pyfda will import class as follows: from filter_blocks.fda import FIRFilter
    parameters can be set and simulation run as follows:
    hdlfilter = FIRFilter()
    hdlfilter.set_coefficients(b)
    hdlfilter.run_sim()
    y = hdlfilter.get_response()
  • #55 (issue) demo of fixpoint simulation to be carried out for the fir_df1 filter. Output would be returned as a numpy array.
  • Rounding modes support (ceiling, floor etc.) has to be provided in filter-blocks repo
  • further discussion on limiting wordlengths based on FPGA family for optimal use of resources, providing warnings if wordlength is not ideal.
I may have missed some points
Christopher Felton
@cfelton
@sriyash25 good summary, that covers it.
Christopher Felton
@cfelton
adding the import to the code example
from filter_blocks.fda import FIRFilter

hdlfilter = FIRFilter()            # Standard DF1 filter 
hdlfilter.set_coefficients(b)      # Coefficients for the filter
hdlfilter.set_stimulation(x)       # Set the simulation input
hdlfilter.run_sim()                # Run the simulation
y = hdlfilter.get_response()       # Get the response from the simulation
note, on the pyfda side, the simulation should probably run in a separate thread or subprocess
Sriyash Caculo
@sriyash25
@chipmuenk , @cfelton So far, I was using a tool called gtkwave to view the waveform and verify outputs of simulation. I had written small test benches to pass parameters to the filter block and trace the signal. The test bench would output a .vcd file which can be viewed using the tool mentioned. here is the test bench for fir_df1: https://github.com/cfelton/filter-blocks/blob/master/tests/test_fir/test_df1.py . Of course, this code will not be necessary once the parameters are being passed from PyFDA, but I suppose for now , we still want output the .vcd file to verify simulation results?
Christopher Felton
@cfelton
this is a good way to start and debug
in the filter_blocks package we want to automated tests for everything, 100% tested
the tests will need to be self checking.
you could do something like an impulse input and verify the impulse out (for the fir will be the coefficients)
or you can verify the response for a subset of filters
Sriyash Caculo
@sriyash25
But how do we verify simulation results once we pass parameters using PyFDA instead of the testbench? do we still need to trace the signal and generate the .vcd file or simply pass y back to pyfda?
Christopher Felton
@cfelton
there should be an option to enable tracing
same that exists now
hdlfilter.config_sim(trace=True)
that is a debug option, generally shoudn't be needed.
Sriyash Caculo
@sriyash25
Right, got it
Christopher Felton
@cfelton
the pyfda will be able to plot the input signal and output signal, in someways it provides manual verification
Animesh Srivastava
@animeshsrivastava24
Hello, my name is Animesh Srivastava. I am a 4th Year student from NIT Hamirpur, India from Electronics and Communication Branch. I am looking forward to contribute to pyFDA. I have an experience of 2 years working with Python Language and Verilog. I am open to learn new skills and develop my prowess. I believe that my experience will help me to work on this project. Please guide me with the initial task to move on with it. Regards.
Christian Münker
@chipmuenk
Hello Animesh,
Animesh Srivastava
@animeshsrivastava24
I'm highly thankful to your reply @chipmuenk , hello.
Christian Münker
@chipmuenk
thanks for your interest in the pyfda project, @animeshsrivastava24 ! Unfortunately, I'm really busy at the moment, I haven't even managed to fully merge Sriyash's work until now. I'm afraid I won't find any time for pyfda related activities till the end of the year. I'm planning to better integrate @sriyash25 's and @cfelton 's contributions to myhdl / pyfda integration in the quiet time between Xmas and mid of January, your expertise would be highly welcome then.
Animesh Srivastava
@animeshsrivastava24
@chipmuenk I'm aiming for GSOC 2019. Sure, I'm enthusiastically looking for contributions. Meanwhile I'm devoting my time to learn more about the project and fixing initial bugs and issues mentioned.