Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 757
» Latest member: aleks.g
» Forum threads: 195
» Forum posts: 650

Full Statistics

Latest Threads
JTAG and Stimulifile
Forum: PULP General questions
Last Post: ufsahu
07-12-2021, 09:14 AM
» Replies: 2
» Views: 561
Pulpissimo porting to Zep...
Forum: PULP General questions
Last Post: stefanct
07-05-2021, 01:32 AM
» Replies: 2
» Views: 317
How to get in64_t working...
Forum: PULP General questions
Last Post: Dom2231
06-30-2021, 02:19 PM
» Replies: 2
» Views: 310
Bitstream generation of N...
Forum: PULP General questions
Last Post: LarsKeuninckx
06-25-2021, 12:38 PM
» Replies: 1
» Views: 673
*OpenOCD compilation erro...
Forum: PULP General questions
Last Post: LarsKeuninckx
06-25-2021, 09:35 AM
» Replies: 0
» Views: 168
pulp optimization problem...
Forum: PULP General questions
Last Post: meggiman
06-24-2021, 07:05 AM
» Replies: 1
» Views: 251
Is SYNTHESIS, ASIC_SYNTHE...
Forum: PULP General questions
Last Post: meggiman
06-24-2021, 06:52 AM
» Replies: 1
» Views: 606
pulp optimization problem...
Forum: PULP General questions
Last Post: kgf
06-18-2021, 05:59 AM
» Replies: 1
» Views: 284
Tock OS on pulpissimo
Forum: PULP General questions
Last Post: bluewww
06-01-2021, 11:25 AM
» Replies: 1
» Views: 397
Queries in FPU for cv32e4...
Forum: PULP General questions
Last Post: mlmram
05-19-2021, 07:19 AM
» Replies: 0
» Views: 427

 
  How to get in64_t working as well as C++ builds
Posted by: Dom2231 - 06-30-2021, 01:57 PM - Forum: PULP General questions - Replies (2)

Hi everyone,

I'm currently working on my Master's thesis where I need to implement a software algorithm using 36 bit integers. My first approach was using the int64_t C type to represent my number. While it all worked fine on my local machine the algorithm broke in the Pulpissimo simulator.

After a while of debugging I figured out that the int64_t type does not work for me. To get started I modified `pulp-rt-examples/hello/test.c` to the code printed below, which is also a small example showing the issue that int64_t types always return the same value. I'm not sure whether this is a bug or I need to reconfigure something.

Do you have any idea how to solve this? Maybe I need to activate some compile flag or is there some 64-bit extension that I could easily add to the processor core?

I saw that the compiler does also support C++ so I wanted to give this a try but I couldn't find an example project to see how I can get the C++ compiler running. Simply changing the file extension from *.c to *.cpp did not work unfortunately.

Thank you very much Smile

BR
Dominik


Code:
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
 // Everything works when changing
 // int64_t to int32_t
 int64_t foo = 42;

 // Prints 0 instead of 42
 printf("\r\n%ld\r\n", foo);

 return 0;
}

Print this item

Information *OpenOCD compilation errors WITH SOLUTIONS*
Posted by: LarsKeuninckx - 06-25-2021, 09:35 AM - Forum: PULP General questions - No Replies

Compiling OpenOCD (with gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0) as described in https://github.com/pulp-platform/pulpiss...l-platform, section "GDB and OpenOCD":

Code:
source sourceme.sh && ./pulp-tools/bin/plpbuild checkout build --p openocd --stdout

This error was encountered:

Code:
In function 'memset',
    inlined from 'mg_gen_ataid' at src/flash/mflash.c:1162:2,
    inlined from 'mg_storage_config' at src/flash/mflash.c:1174:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:71:10: error: '__builtin_memset' offset [509, 512] from the object at 'buff' is out of the bounds of referenced subobject 'reserved7' with type 'mg_io_uint8[186]' {aka 'unsigned char[186]'} at offset 322 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:3344: src/flash/mflash.lo] Error 1
make[2]: Leaving directory '/home/thom/Argus/pulpissimo/pulp-sdk/tools/riscv-openocd'
make[1]: *** [Makefile:4283: install-recursive] Error 1
make[1]: Leaving directory '/home/thom/Argus/pulpissimo/pulp-sdk/tools/riscv-openocd'
make: *** [Makefile:4585: install] Error 2
Reached EOF with exit status 2
FATAL ERROR: the command 'build' has failed


SOLUTION: see https://githubmemory.com/repo/STMicroele...OCD/issues, user nretro's comment:
 
Quote:  In src/flash/mflash.h the line

  
Code:
mg_io_uint8 reserved7[186];

 
Quote:  should be changed to

   
Code:
mg_io_uint8 reserved7[190];



Quote:This is obviously an error, since in mflash.c reserved7 is accessed using
    memset(pSegIdDrvInfo->reserved7, 0x00, 190);

    Current gcc compiler flags this with an out of bound warning. In combination with the "Werror" flag, the compilation will be aborted.


After fixing that error, this one appears:


Code:
In file included from src/helper/options.c:38:
/usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: error: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror=cpp]
   21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
      |  ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:3359: src/helper/libhelper_la-options.lo] Error 1
make[2]: Leaving directory '/home/thom/Argus/pulpissimo/pulp-sdk/tools/riscv-openocd'
make[1]: *** [Makefile:4283: install-recursive] Error 1
make[1]: Leaving directory '/home/thom/Argus/pulpissimo/pulp-sdk/tools/riscv-openocd'
make: *** [Makefile:4585: install] Error 2
Reached EOF with exit status 2
FATAL ERROR: the command 'build' has failed

SOLUTION: see https://github.com/rr-debugger/rr/commit...49d49cfe5d
Apply these changes  to pulp-sdk/tools/riscv-openocd/src/helper/options.c:

   
Code:
#if IS_DARWIN
    #include <libproc.h>
    #endif

    #include <sys/syscall.h>
    //#ifdef HAVE_SYS_SYSCTL_H
    //#include <sys/sysctl.h>
    //#endif

    #ifndef CTL_KERN
    #define CTL_KERN 1
    #endif
    #ifndef KERN_RTSIGMAX
    #define KERN_RTSIGMAX 33
    #endif

    (...)    
            char *path = malloc(PATH_MAX);
            if (path == NULL)
                break;
            int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
            size_t size = PATH_MAX;


            if (syscall(RR__sysctl, mib, (u_int)ARRAY_SIZE(mib), path, &size, NULL, 0) != 0)
            //if (sysctl(mib, (u_int)ARRAY_SIZE(mib), path, &size, NULL, 0) != 0)
                break;
     



Posted here so you don't have to waste the time we did. After that, the compilation works. Good luck.

Print this item

  Pulpissimo porting to Zephyr RTOS
Posted by: RiscV - 06-18-2021, 05:48 AM - Forum: PULP General questions - Replies (2)

Hi team,
I am trying to run pulp-rt examples on the Zephyr platform, but I didn't find any documentation regarding this.
Is pulpissimo run on Zephyr RTOS?  If pulp supports Zephyr, can you help me to find the documentation/steps? Your help in this regard is highly appreciated.

Thanks in advance
RiscV

Print this item

  pulp optimization problem,not getting expected output.
Posted by: pallavi@76 - 06-17-2021, 07:34 AM - Forum: PULP General questions - Replies (1)

|project|loc_Bangalore|loc_Pune|cat_s|cat_c|
|:------|:-----------:|:------:|:---:| ---:|
|abc    |1            |0       |0    |1    |
|Sys    |1            |0       |0    |1    |
|Syst   |0            |1       |1    |0    |
|EPS    |1            |0       |0    |1    |
|foss   |1            |0       |0    |1    |
|opc    |0            |1       |1    |0    |

> want list of projects,which should satisfy below condition:
   
 1. count of project related to loc_Bangalore <=3
 2. count of project related to loc_pune <=2
 3. count of project related to cat_c <=4
 4. count of project related to cat_s <=1
 5. total project selected <=5(final condition).

> whatever project will come in output it should fullfill all 5 condition.

I tried soe code:
 but not getting expected result.

    prob = LpProblem("choose project")
    project_list = list(df['project'])
    banglore = dict(zip(project_list,df['loc_Bangalore']))
    pune = dict(zip(project_list,df['loc_Pune']))
    c = dict(zip(project_list,df['cat_C']))
    s = dict(zip(project_list,df['cat_S']))
    proj_vars = pulp.LpVariable.dicts("project",project_list,cat='Binary')
    no_of_project_choose = 5
    prob += pulp.lpSum([banglore[f] * proj_vars[f] for f in project_list]) <= 3
    prob += pulp.lpSum([pune[f] * proj_vars[f] for f in project_list]) <=2
    prob += pulp.lpSum([c[f]  * proj_vars[f] for f in project_list]) <=4
    prob += pulp.lpSum([s[f]  * proj_vars[f] for f in project_list]) <=1
    prob += pulp.lpSum([[banglore[f] * proj_vars[f] for f in project_list]+[pune[f] * proj_vars[f] for f in project_list]+
         [c[f]  * proj_vars[f] for f in project_list]+[s[f]  * proj_vars[f] for f in project_list]]) <=5
    prob.solve()

> output:   abc 0.0,   sys 0.0,   syst None,   EPS 0.0 ,  foss 0.0 ,  opc
> None(i am getting all project with 0 or some number line abc 9)

Pls help me in solving this.I want only project which satisfy other condition also(like banglore, pune,c and s).
is there anyother way of solving this?
i m not sue about my solution and way of solving.plz help.

Print this item

  pulp optimization problem,not getting expected output.
Posted by: pallavi@76 - 06-17-2021, 07:33 AM - Forum: PULP General questions - Replies (1)

|project|loc_Bangalore|loc_Pune|cat_s|cat_c|
|:------|:-----------:|:------:|:---:| ---:|
|abc    |1            |0       |0    |1    |
|Sys    |1            |0       |0    |1    |
|Syst   |0            |1       |1    |0    |
|EPS    |1            |0       |0    |1    |
|foss   |1            |0       |0    |1    |
|opc    |0            |1       |1    |0    |

> want list of projects,which should satisfy below condition:
   
 1. count of project related to loc_Bangalore <=3
 2. count of project related to loc_pune <=2
 3. count of project related to cat_c <=4
 4. count of project related to cat_s <=1
 5. total project selected <=5(final condition).

> whatever project will come in output it should fullfill all 5 condition.

I tried soe code:
 but not getting expected result.

    prob = LpProblem("choose project")
    project_list = list(df['project'])
    banglore = dict(zip(project_list,df['loc_Bangalore']))
    pune = dict(zip(project_list,df['loc_Pune']))
    c = dict(zip(project_list,df['cat_C']))
    s = dict(zip(project_list,df['cat_S']))
    proj_vars = pulp.LpVariable.dicts("project",project_list,cat='Binary')
    no_of_project_choose = 5
    prob += pulp.lpSum([banglore[f] * proj_vars[f] for f in project_list]) <= 3
    prob += pulp.lpSum([pune[f] * proj_vars[f] for f in project_list]) <=2
    prob += pulp.lpSum([c[f]  * proj_vars[f] for f in project_list]) <=4
    prob += pulp.lpSum([s[f]  * proj_vars[f] for f in project_list]) <=1
    prob += pulp.lpSum([[banglore[f] * proj_vars[f] for f in project_list]+[pune[f] * proj_vars[f] for f in project_list]+
         [c[f]  * proj_vars[f] for f in project_list]+[s[f]  * proj_vars[f] for f in project_list]]) <=5
    prob.solve()

> output:   abc 0.0,   sys 0.0,   syst None,   EPS 0.0 ,  foss 0.0 ,  opc
> None(i am getting all project with 0 or some number line abc 9)

Pls help me in solving this.I want only project which satisfy other condition also(like banglore, pune,c and s).
is there anyother way of solving this?
i m not sue about my solution and way of solving.plz help.

Print this item

  Tock OS on pulpissimo
Posted by: cyberbemon - 05-31-2021, 02:28 PM - Forum: PULP General questions - Replies (1)

I've been looking at porting Tock OS on to the pulp platform and mostly reading through the documentation. I'm fairly new to this whole thing, so I have few questions. According to the TockOS porting guide, I need to define the following in the linker file

Quote: For most developers, it should
 * be sufficient to define {ROM/PROG/RAM}_{ORIGIN/LENGTH} (6 variables, the start and length for each),
 * MPU_MIN_ALIGN (the minimum alignment granularity supported by the MPU) and PAGE_SIZE (the size of a flash page).
 * If undefined, PAGE_SIZE uses the default value of 512 bytes.

Reading through the pulpissimo datasheet, I was unable to find those exact information, so I was wondering, can I use the Data Memory for PROG? and can I use the Boot ROM for ROM? I don't see anything related to MPU mentioned in the datasheet, so is that not supported for pulp platform? 

Are there any other OS that runs on this platform?

Print this item

  Queries in FPU for cv32e40p
Posted by: mlmram - 05-19-2021, 07:19 AM - Forum: PULP General questions - No Replies

Hi,

I ran the cv32e40p (RI5CY) core with FPU (floating point) enabled and tried to check the result for all the floating-point operations. I have faced the following issues in case of division and fused operations.

  • Rounding mode output is incorrect for division, rounding mode for the division is not the same as addition, subtraction, and multiplication
    For example, when rounding mode is RTZ (round to zero), the guard, round and sticky flags aren't ignored and the final output is changed by 1 bit.
  • Exception status flags output is incorrect for division, exception status flags output for the division is not the same as addition, subtraction, and multiplication, and doesn't follow IEEE754
    For example, the overflow flag is not generated even if the division result generated is infinity (for MAX/MIN case).
  • Rounding mode output is incorrect for fused operations, rounding mode for fused operations is not the same as addition, subtraction, and multiplication
    For example, when rounding mode is RTZ (round to zero), the guard, round and sticky flags aren't ignored and the final output is changed by 1 bit.
  • Getting output as X in fused operations if any of the operands is 0
    For example, If any of the 3 operands are 0 in FMA, the result generated by the core is X.

These are the inputs I have given. All the following data is for 32-bit FPU, input1, input2, input3, output, and the expected output are represented in {1-bit sign, 8-bit exponent, 23-bit mantissa}, and status and expected status are represented as {Invalid, Divide by Zero, Overflow, Underflow, Inexact}

Division:

Input1 - 1_10000010_11011100000100010010000
Input2 - 1_00000001_11110010110000000000000
Out - 0_11111111_00000000000000000000000
Expected out - 0_11111110_11111111111111111111111
Status - 00100
Expected status - 00001
Rounding mode - RTZ (Round to Zero)
Operation - Division
The Input1 is being divided with Inp2 which is a very large number, the result should overflow and give infinity as the output, but as the rounding mode is RTZ (round to zero), the output should be the maximum possible number in a 32-bit floating-point number instead of infinity.


Input1 - 0_00000000_00000000000000000000000
Input2 - 1_11111111_00000000000000000000000
Out - 1_00000000_00000000000000000000000
Expected out - 1_00000000_00000000000000000000000
Status - 00100
Expected status - 00000
Rounding mode - RTZ (Round to Zero)
Operation - Division
0/Inf is giving overflow status even though the output is not infinity


Input1 - 0_01111110_11100000000000000000000
Input2 - 0_01111111_00000000000000000000001
Out - 0_01111110_01111111111111111111111
Expected out - 0_01111110_01111111111111111111110
Status - 00001
Expected status - 00001
Rounding mode - RDN (Round Down)
Operation - Division
The expected data is 0_01111110_01111111111111111111110 but getting output as 0_01111110_01111111111111111111111, both the inputs are positive and the rounding mode is round down, so the output shouldn't be changing because of the rounding mode

Fused Multiply Add:
Input1 - 0_00000000_00000000000000000000000
Input2 - 0_00000000_00000000000000000000000
Input3 - 0_00100100_00101010011010100100100
Out - x_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxx
Expected out - 0_00100100_00101010011010100100100
Status - 000xx
Expected status - 00000
As input1 and input2 are 0, the output should be input3, but getting X from the core whenever any one of the inputs is 0 for fused operations.


Please let me know if these are the bugs in the core or the FPU, or if there's anything wrong with my understanding of floating-point operations.

Print this item

  Is SYNTHESIS, ASIC_SYNTHESIS Flag needed during Synthesis
Posted by: vignajeth - 05-06-2021, 04:06 PM - Forum: PULP General questions - Replies (1)

Hi,
   I notice in a lot of places in the entire pulpisismo code that contains ifndef depending upon the flag SYNTHESIS, I also notice ASIC_SYNTHESIS flag being used inside the Ri5cy.
I also find PULP_TRAINING flag in the code

 Example in soc_peripherals.sv

`ifdef PULP_TRAINING
`ifndef SYNTHESIS

    apb_dummy_registers  #(.APB_ADDR_WIDTH(APB_ADDR_WIDTH)) i_apb_dummy_reg_unit (
        .HCLK       ( clk_i                   ),
        .HRESETn    ( rst_ni                  ),
        .PADDR      ( s_apb_dummy_bus.paddr   ),
        .PWDATA     ( s_apb_dummy_bus.pwdata  ),
        .PWRITE     ( s_apb_dummy_bus.pwrite  ),
        .PSEL       ( s_apb_dummy_bus.psel    ),
        .PENABLE    ( s_apb_dummy_bus.penable ),
        .PRDATA     ( s_apb_dummy_bus.prdata  ),
        .PREADY     ( s_apb_dummy_bus.pready  ),
        .PSLVERR    ( s_apb_dummy_bus.pslverr )
    );

`endif
`endif

should these flags be passed through the synthesis as a macro ?

Print this item

  JTAG and Stimulifile
Posted by: ufsahu - 05-06-2021, 02:04 PM - Forum: PULP General questions - Replies (2)

Hi,

I am very new to JTAG and have worked with pulpissimo by running test cases mostly via the Linux terminal, which has Questasimulation. 

I wanted to ask that how can I either create or locate an existing stimulifile, and further use it for JTAG programming? Also, which software would be good for JTAG programming?

Usually, when I make and run C-based test cases in the terminal, I am checking whether basic functions are working or not (since we are dealing with a constrained system and also my background is not very strong when it comes to architecture design-based projects). So if I run a test.c file using makefile, when using the command 'make clean all run' does this automatically create a stimulifile for this test.c somewhere in the directory? If yes, how can I locate it?
 
If not, how can create one for this test.c?



Thanks!

Print this item

  Use of -nostdlib in pulp-sdk
Posted by: stefanct - 04-28-2021, 10:06 AM - Forum: PULP General questions - No Replies

Hi,
I am working on various things related to GCC, e.g., LTO, GCC plugins etc. on Pulpissimo. To that end I have modified the contents of pulp-gcc-toolchain and pulp-sdk in the past. One thing that caused some problems was the linker option -nostdlib that's inserted by default by pulp-sdk to the generated makefiles. I always expected it to be absolutely necessary and did not scrutinize it further. However, when I simply tried to remove it everything still seems to remain working when running the binary in the FPGA.

So my question is... What's the rationale to use -nostdlib at all? It is included since the very last commit of pulp-sdk.
NB: The sdk also emits -nostartfiles too (which is implied by -nostdlib).

KR

Print this item