Menu

How to implement the CLIPS core on an MCU-based card

Help
2020-02-19
2020-02-21
  • Noureddine KHANFIR

    Hi,
    I have a problem when using Clips core an MCU-based card. The problem is that I'm using a small MCU card with 128KB RAM and 512KB FLASH, while the CLIPS core is almost 16Mb. (libclips.a the main library of the core takes 2.5Mb)
    Inside, I need to optimize the core so that I can implement it on my card.
    So as a little recap:
    - Our MCU is small, 128KB RAM and 512K FLASH so knowing the minimum memory footprint/disk footprint information would be nice
    - Is there any way to disable certain features at compile time
    - We don't have a Filesystem so this can have an impact on CLISPS which uses files especially for rules written in a DSL close to LISP.

     

    Last edit: Noureddine KHANFIR 2020-02-19
    • Gary Riley

      Gary Riley - 2020-02-21

      There's a section in the Advanced Programming Guide that has information on compiling CLIPS and disabling features. You can significantly reduce the size of the exectuable if you disable a number of features. For example, if you disable all of the constructs other than defrule and deftemplate and disable various functions and commands, you could get an application that wasn't too memory intensive to run within 640K. We were able to do that decades ago when CLIPS had fewer features and Windows PC still had the 640K memory limit. If you're running a dedicated application, you can use the construct compiler (also described in the Advanced Programming Guide) to create a standalone executable containing all of your rules so that they don't need to be loaded from a file. This has the additional benefit of further reducing the amount of memory needed as the code for parsing constructs will not be included with the executable.

       
      • Gary Riley

        Gary Riley - 2020-02-21

        If you try to recompile the CLIPS source code to remove features, get the latest source from https://sourceforge.net/p/clipsrules/code/HEAD/tree/. There were a few compilation errors for disabling features introduced in the 6.31 release that were not present in the 6.30 release.

         

Log in to post a comment.