OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [rtl/] [src_openpiton/] [custom_include.v] - Blame information for rev 56

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 alirezamon
 
2
//get new x according to concentration
3
function integer get_pronoc_X;
4
    input integer piton_nx;  // openpiton x
5
    input integer piton_ny;  // openpiton y
6
    input integer concent;   //concentration value
7
    input integer dim_max_diff; // max allowable diff between pronoc_x and pronoc_y
8
        integer min , x , y, size, diff;
9
    begin
10
        if  (concent == 1) get_pronoc_X = piton_nx;
11
        else begin
12
            get_pronoc_X = 0;
13
            min = piton_nx * piton_ny * concent * 2;
14
            for (x = 1; x <= piton_nx; x=x+1) begin
15
                for (y = 1; y<=piton_ny; y=y+1) begin
16
                    size = x * y * concent;
17
                    diff = (x<y) ? y - x : x - y;
18
                    if ( size >= (piton_nx * piton_ny) && diff <= dim_max_diff &&  size < min ) begin
19
                        min = size;
20
                        get_pronoc_X = x;
21
                    end
22
                end
23
            end
24
        end
25
    end
26
endfunction
27
 
28
//get new x according to concentration
29
function integer get_pronoc_Y;
30
    input integer piton_nx;  // openpiton x
31
    input integer piton_ny;  // openpiton y
32
    input integer concent;   //concentration value
33
    input integer dim_max_diff; // max allowable diff between pronoc_x and pronoc_y
34
        integer min , x , y, size, diff;
35
    begin
36
        if  (concent == 1) get_pronoc_Y = piton_ny;
37
        else begin
38
            get_pronoc_Y = 0;
39
            min = piton_nx * piton_ny * concent *2;
40
            for (x = 1; x <= piton_nx; x=x+1) begin
41
                for (y = 1; y<=piton_ny; y=y+1) begin
42
                    size = x * y * concent;
43
                    diff = (x<y) ? y - x : x - y;
44
                    if ( size >= (piton_nx * piton_ny) && diff <= dim_max_diff &&  size < min ) begin
45
                        min = size;
46
                        get_pronoc_Y = y;
47
                    end
48
                end
49
            end
50
        end
51
    end
52
endfunction

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.