{
  extends: ['config:base', 'schedule:earlyMondays'],
  baseBranches: ['master', '3.20', '3.27', '3.28', '3.29'],
  packageRules: [
    /** Automerge the patch, the minor and the dev dependency */
    {
      matchBaseBranches: ['master'],
      matchUpdateTypes: ['minor', 'patch'],
      automerge: true,
    },
    {
      matchDepTypes: ['devDependencies'],
      automerge: true,
    },
    /** Group the patch and the minor */
    {
      matchUpdateTypes: ['patch'],
      groupName: 'all patch versions',
      automerge: true,
    },
    {
      matchUpdateTypes: ['minor'],
      groupName: 'all minor versions',
      automerge: true,
    },
    /** Ungroup some minor */
    {
      matchUpdateTypes: ['minor'],
      matchPackageNames: ['gradle'],
      groupName: 'gradle',
      automerge: true,
    },
    {
      matchUpdateTypes: ['minor'],
      matchPackagePrefixes: ['org.springframework:spring-'],
      groupName: 'spring',
      automerge: true,
    },
    /** Accept only the patch on the stabilization branches */
    {
      matchBaseBranches: ['/3\\..*/'],
      matchUpdateTypes: ['major', 'minor', 'pin', 'digest', 'lockFileMaintenance', 'rollback', 'bump'],
      enabled: false,
    },
  ],
}

Add sprint security to sprint group

{
  extends: ['config:base', 'schedule:earlyMondays'],
  baseBranches: ['master', '3.20', '3.27', '3.28', '3.29'],
  packageRules: [
    /** Automerge the patch, the minor and the dev dependency */
    {
      matchBaseBranches: ['master'],
      matchUpdateTypes: ['minor', 'patch'],
      automerge: true,
    },
    {
      matchDepTypes: ['devDependencies'],
      automerge: true,
    },
    /** Group the patch and the minor */
    {
      matchUpdateTypes: ['patch'],
      groupName: 'all patch versions',
      automerge: true,
    },
    {
      matchUpdateTypes: ['minor'],
      groupName: 'all minor versions',
      automerge: true,
    },
    /** Ungroup some minor */
    {
      matchUpdateTypes: ['minor'],
      matchPackageNames: ['gradle'],
      groupName: 'gradle',
      automerge: true,
    },
    {
      matchUpdateTypes: ['minor'],
      matchPackagePrefixes: ['org.springframework:spring-', 'org.springframework.security:spring-'],
      groupName: 'spring',
      automerge: true,
    },
    /** Accept only the patch on the stabilization branches */
    {
      matchBaseBranches: ['/3\\..*/'],
      matchUpdateTypes: ['major', 'minor', 'pin', 'digest', 'lockFileMaintenance', 'rollback', 'bump'],
      enabled: false,
    },
  ],
}


{
    "BASELINE_SERVER_IMAGE": "gcr.io/skia-public/gold-baseline-server:2022-03-14T15_10_06Z-kjlubick-91a7e15-clean",
    "DIFFCALCULATOR_IMAGE":  "gcr.io/skia-public/gold-diffcalculator:2022-03-14T15_12_24Z-kjlubick-91a7e15-clean",
    "FRONTEND_IMAGE":        "gcr.io/skia-public/gold-frontend:2022-03-14T15_12_50Z-kjlubick-91a7e15-clean",
    "GITILESFOLLOWER_IMAGE": "gcr.io/skia-public/gold-gitilesfollower:2022-03-14T15_13_19Z-kjlubick-91a7e15-clean",
    "INGESTION_IMAGE":       "gcr.io/skia-public/gold-ingestion:2022-03-14T15_13_32Z-kjlubick-91a7e15-clean",
    "PERIODICTASKS_IMAGE":   "gcr.io/skia-public/gold-periodictasks:2022-03-14T15_14_00Z-kjlubick-91a7e15-clean",
}

Update all but frontend image

{
    "BASELINE_SERVER_IMAGE": "gcr.io/skia-public/gold-baseline-server:2022-04-18T14_07_21Z-kjlubick-50371c5-clean",
    "DIFFCALCULATOR_IMAGE":  "gcr.io/skia-public/gold-diffcalculator:2022-04-18T14_08_30Z-kjlubick-50371c5-clean",
    "FRONTEND_IMAGE":        "gcr.io/skia-public/gold-frontend:2022-03-14T15_12_50Z-kjlubick-91a7e15-clean",
    "GITILESFOLLOWER_IMAGE": "gcr.io/skia-public/gold-gitilesfollower:2022-04-18T14_08_55Z-kjlubick-50371c5-clean",
    "INGESTION_IMAGE":       "gcr.io/skia-public/gold-ingestion:2022-04-18T14_09_15Z-kjlubick-50371c5-clean",
    "PERIODICTASKS_IMAGE":   "gcr.io/skia-public/gold-periodictasks:2022-04-18T14_09_35Z-kjlubick-50371c5-clean",
}


{
  mpower: {
    "mpower.03": {
      address: "192.168.2.212:22",
      user: "ubnt",
      ports: {
        "skia-e-linux-013": 1,
        "skia-e-linux-014": 2,
        "skia-e-linux-015": 3,
        "skia-e-linux-016": 4,
        "skia-e-linux-017": 5,
        "skia-e-linux-018": 6,
        "test-relay": 7
      }
    }
  }
}

Add linux machines to powercycle config


{
  skiastatus: {
    urls: ['https://status.skia.org'],
    method: 'GET',
    expected: [200],
    body: '',
    mimetype: '',
  },
  skiastatus_json: {
    urls: ['https://status.skia.org/twirp/status.StatusService/GetIncrementalCommits'],
    method: 'POST',
    expected: [200],
    body: '',
    mimetype: 'application/json',
    responsetest: 'validJSON',
  },
}

Add required GetIncrementalCommits body to prober.

{
  skiastatus: {
    urls: ['https://status.skia.org'],
    method: 'GET',
    expected: [200],
    body: '',
    mimetype: '',
  },
  skiastatus_json: {
    urls: ['https://status.skia.org/twirp/status.StatusService/GetIncrementalCommits'],
    method: 'POST',
    expected: [200],
    body: '{"repo_path": "skia"}',
    mimetype: 'application/json',
    responsetest: 'validJSON',
  },
}


{
  "apps": [

    {
      "name": "league-tooltips-demo",
      "script": "app.js",
      "env": {
        "KEY_RIOT": "API_KEY",
        "PORT": 9000
      },
      "args": ["--release"],
      "watch": false,
    }

  ]

}

Append 'production' to PM2 process name


{
   "autoroll": {
     "urls": [
       "https://autoroll.skia.org",
       "https://autoroll.skia.org/r/skia-autoroll"
     ],
     "method": "GET",
     "expected": [200],
     "body": "",
     "mimetype": ""
   },
   "autoroll_json": {
     "urls": [
       "https://autoroll.skia.org/json/all",
       "https://autoroll.skia.org/r/skia-autoroll/json/ministatus",
       "https://autoroll.skia.org/r/skia-autoroll/json/status"
     ],
     "method": "GET",
     "expected": [200],
     "body": "",
     "mimetype": "application/json",
     "responsetest": "validJSON"
   },
   "autoroll_post_deny": {
     "urls": [
       "https://autoroll.skia.org/r/skia-autoroll/json/mode",
       "https://autoroll.skia.org/r/skia-autoroll/json/strategy",
       "https://autoroll.skia.org/r/skia-autoroll/json/unthrottle"
     ],
     "method": "POST",
     "expected": [403],
   }
}

Update probers after Twirp switch

not allowed


{
  authorized_users: [
    "google.com",
  ],
  client_secret_file: "/etc/skia.org/login.json",
  disable_sql_exp_cl: true,
  flaky_trace_threshold: 10000, // no trace is flaky
  frontend: {
    baseRepoURL: "<inherited from git_repo_url>",
    defaultCorpus: "flutter-engine",
    title: "Flutter Engine Gold",
  },
  prom_port: ":20000",
  ready_port: ":8000",
  resources_path: "/usr/local/share/frontend/dist",
  tile_freshness: "1m",
  trace_bt_table: "gold-flutter-engine",

  // These values affect the k8s deployment; they are not read in by the binary.
  K8S_CPU: 4,
  K8S_LOGIN_SECRETS: "skia-org-legacy-login-secrets",
  K8S_MEMORY: "4Gi",
}

Add flutter-engine service account to authorized_users

{
  authorized_users: [
    "google.com",
    "flutter-try-builder@chops-service-accounts.iam.gserviceaccount.com",
    "flutter-staging-builder@chops-service-accounts.iam.gserviceaccount.com",
    "flutter-prod-builder@chops-service-accounts.iam.gserviceaccount.com",
  ],
  client_secret_file: "/etc/skia.org/login.json",
  disable_sql_exp_cl: true,
  flaky_trace_threshold: 10000, // no trace is flaky
  frontend: {
    baseRepoURL: "<inherited from git_repo_url>",
    defaultCorpus: "flutter-engine",
    title: "Flutter Engine Gold",
  },
  prom_port: ":20000",
  ready_port: ":8000",
  resources_path: "/usr/local/share/frontend/dist",
  tile_freshness: "1m",
  trace_bt_table: "gold-flutter-engine",

  // These values affect the k8s deployment; they are not read in by the binary.
  K8S_CPU: 4,
  K8S_LOGIN_SECRETS: "skia-org-legacy-login-secrets",
  K8S_MEMORY: "4Gi",
}


{
  "Servers": {
    "skia-fuzzer-fe": {
      "AppNames": [
        "pulld",
        "fuzzer-fe",
      ],
    },
    "skia-fuzzer-be-1": {
      "AppNames": [
        "pulld",
        "fuzzer-be-1",
      ],
    },
    "skia-fuzzer-be-2": {
      "AppNames": [
        "pulld",
        "fuzzer-be-2",
      ],
    },
    "skia-fuzzer-be-3": {
      "AppNames": [
        "pulld",
        "fuzzer-be-3",
      ],
    },
  }
}

Remove fuzzer backends from push

{
  "Servers": {
    "skia-fuzzer-fe": {
      "AppNames": [
        "pulld",
        "fuzzer-fe",
      ],
    },
  }
}


{
  // The host and port to listen on.
  host: "0.0.0.0",
  port: 7777,

  // Length of the paste identifier in URL.
  keyLength: 10,

  keyGenerator: {
    type: "phonetic"
  },

  storage: {
    type: "file",
    path: "./data"
  },

  // Static documents to serve (e.g. http://hastebin.com/about.md) in addition
  // to static assets. These will never expire.
  documents: {
    about: "./about.md"
  },

  // Maximum paste size in kilobytes.
  pasteMaxSize: 400,

  // Settings for static assets cache; see https://github.com/isaacs/st#usage.
  staticCache: {
    content: {
      max: 2097152,   // How much memory to use on caching contents (in bytes).
      maxAge: 86400,  // How long to cache contents for (in seconds).
      cacheControl: "public, max-age=86400"
    }
  },

  // Logging preferences; see https://github.com/winstonjs/winston#working-with-transports.
  logging: [
    {
      level: "verbose",
      type: "Console",
      colorize: true
    }
  ]
}

Change default keySize to 7 and pasteMaxSize to 384

{
  // The host and port to listen on.
  host: "0.0.0.0",
  port: 7777,

  // Length of the paste identifier in URL.
  keyLength: 7,

  keyGenerator: {
    type: "phonetic"
  },

  storage: {
    type: "file",
    path: "./data"
  },

  // Static documents to serve (e.g. http://hastebin.com/about.md) in addition
  // to static assets. These will never expire.
  documents: {
    about: "./about.md"
  },

  // Maximum paste size in kilobytes.
  pasteMaxSize: 384,

  // Settings for static assets cache; see https://github.com/isaacs/st#usage.
  staticCache: {
    content: {
      max: 2097152,   // How much memory to use on caching contents (in bytes).
      maxAge: 86400,  // How long to cache contents for (in seconds).
      cacheControl: "public, max-age=86400"
    }
  },

  // Logging preferences; see https://github.com/winstonjs/winston#working-with-transports.
  logging: [
    {
      level: "verbose",
      type: "Console",
      colorize: true
    }
  ]
}


// This is the pm2 configuration file for npms-api
{
    apps: [
        {
            name: 'npms-api',
            script: './server.js',
            args: [],
            instances: 3,
            env : { NODE_ENV: 'production' },
            max_memory_restart: '1500M'
        },
    ],
    deploy: {
        production: {
            user: 'www',
            host: '163.172.160.79',
            ref: 'origin/master',
            repo: 'https://github.com/npms-io/npms-api.git',
            path: '/home/www/npms-api',
            'post-deploy': '\
cp ../local.json5 ./config/ && \
npm update --loglevel http --production && \
pm2 startOrRestart ecosystem.json5 --env production',
        },
    },
}

Disable pmx and tweak memory limits.

// This is the pm2 configuration file for npms-api
{
    apps: [
        {
            name: 'npms-api',
            script: './server.js',
            args: [],
            instances: 3,
            env : { NODE_ENV: 'production' },
            max_memory_restart: '2018M',  // Restart if it's getting close to the limit
            node_args: '--max_old_space_size=2048',
            pmx: false,  // We were experiecing PMX has a lot of memory leaks, see: https://github.com/keymetrics/pmx/issues/23
        },
    ],
    deploy: {
        production: {
            user: 'www',
            host: '163.172.160.79',
            ref: 'origin/master',
            repo: 'https://github.com/npms-io/npms-api.git',
            path: '/home/www/npms-api',
            'post-deploy': '\
cp ../local.json5 ./config/ && \
npm update --loglevel http --production && \
pm2 startOrRestart ecosystem.json5 --env production',
        },
    },
}


{
  "apps": [

    {
      "name": "feeder.lol-item-sets-generator.org",
      "script": "dist/index.js",
      "env": {
        "NODE_ENV": "production",
        "HOST": "http://domain.tld",
        "CRON_GENERATOR": "0 */2 * * *", // Every 2 hours
        "MONGO_URI": "mongodb://localhost:27017/lol-item-sets-generator-org",
        "KEY_CHAMPIONGG": "API_KEY",
        "KEY_RIOT": "API_KEY",
        "PORT": 9000
      },
      "args": ["--release"],
      "watch": false,
    }

  ]

}

Add development option in pm2 config file.

{
  "apps": [

    {
      "name": "feeder.lol-item-sets-generator.org",
      "script": "dist/index.js",
      "env_development": {
        "NODE_ENV": "development",
        "HOST": "http://domain.tld",
        "CRON_GENERATOR": "0 */2 * * *", // Every 2 hours
        "MONGO_URI": "mongodb://localhost:27017/lol-item-sets-generator-org",
        "KEY_CHAMPIONGG": "API_KEY",
        "KEY_RIOT": "API_KEY",
        "PORT": 9000
      },
      "env_production": {
        "NODE_ENV": "production",
        "HOST": "http://domain.tld",
        "CRON_GENERATOR": "0 */2 * * *", // Every 2 hours
        "MONGO_URI": "mongodb://localhost:27017/lol-item-sets-generator-org",
        "KEY_CHAMPIONGG": "API_KEY",
        "KEY_RIOT": "API_KEY",
        "PORT": 9000
      },
      "args": ["--release"],
      "watch": false,
    }

  ]

}


// This is the pm2 configuration file for npms-analyzer
{
    apps: [
        {
            name: 'npms-analyzer-observe',
            script: './cli.js',
            args: 'observe',
            instances: 1,
            env : { NODE_ENV: 'production' },
        },
        {
            name: 'npms-analyzer-consume',
            script: './cli.js',
            args: 'consume --concurrency 3',
            instances: 2,
            env : { NODE_ENV: 'production' },
        },
        {
            name: 'npms-analyzer-scoring',
            script: './cli.js',
            args: 'scoring',
            instances: 1,
            env : { NODE_ENV: 'production' },
        },
    ],
    deploy: {
        production: {
            user: 'analyzer',
            host: '163.172.148.133',
            ref: 'origin/master',
            repo: 'https://github.com/npms-io/npms-analyzer.git',
            path: '/home/analyzer/npms-analyzer',
            'post-deploy': '\
cp ../local.json5 ./config/ && \
npm update --loglevel http --production && \
pm2 startOrRestart ecosystem.json5 --env production',
        },
    },
}

Add max_memory_restart to pm2 config.

// This is the pm2 configuration file for npms-analyzer
{
    apps: [
        {
            name: 'npms-analyzer-observe',
            script: './cli.js',
            args: 'observe',
            instances: 1,
            env : { NODE_ENV: 'production' },
            max_memory_restart: '1.5GB'
        },
        {
            name: 'npms-analyzer-consume',
            script: './cli.js',
            args: 'consume --concurrency 3',
            instances: 2,
            env : { NODE_ENV: 'production' },
            max_memory_restart: '1.5GB'
        },
        {
            name: 'npms-analyzer-scoring',
            script: './cli.js',
            args: 'scoring',
            instances: 1,
            env : { NODE_ENV: 'production' },
            max_memory_restart: '1.5GB'
        },
    ],
    deploy: {
        production: {
            user: 'analyzer',
            host: '163.172.148.133',
            ref: 'origin/master',
            repo: 'https://github.com/npms-io/npms-analyzer.git',
            path: '/home/analyzer/npms-analyzer',
            'post-deploy': '\
cp ../local.json5 ./config/ && \
npm update --loglevel http --production && \
pm2 startOrRestart ecosystem.json5 --env production',
        },
    },
}


Add our blank leto.json file for 'leto init'


`define CLOCK_PERIOD 1.0
`define PRINTF_COND TestDriver.printf_cond
`define STOP_COND !TestDriver.reset
`define RANDOMIZE_MEM_INIT
`define RANDOMIZE_REG_INIT
`define RANDOMIZE_GARBAGE_ASSIGN
`define RANDOMIZE_INVALID_ASSIGN

Support Verilator simulation again, {PRINTF,STOP}_COND changed

`define CLOCK_PERIOD 1.0
`ifdef VERILATOR
`define PRINTF_COND $c("done_reset")
`define STOP_COND $c("done_reset")
`else
`define PRINTF_COND !TestDriver.reset
`define STOP_COND !TestDriver.reset
`endif
`define RANDOMIZE_MEM_INIT
`define RANDOMIZE_REG_INIT
`define RANDOMIZE_GARBAGE_ASSIGN
`define RANDOMIZE_INVALID_ASSIGN


module string_utils_unit_test;

  import svunit_pkg::*;
  `include "svunit_defines.svh"

  string name = "string_utils_ut";
  svunit_testcase svunit_ut;

  import svunit_under_test::string_utils;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

    `SVTEST(some_passing_test)
      `FAIL_UNLESS(svunit_under_test::TRUE)
    `SVTEST_END

  `SVUNIT_TESTS_END

endmodule

Add tests for `split_by_char` functions

module string_utils_unit_test;

  import svunit_pkg::*;
  `include "svunit_defines.svh"

  string name = "string_utils_ut";
  svunit_testcase svunit_ut;

  import svunit_under_test::string_utils;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

    `SVTEST(can_split_string_by_underscore)
      string some_string = "some_string";
      string parts[] = string_utils::split_by_char("_", some_string);
      string exp_parts[] = '{ "some", "string" };
      `FAIL_UNLESS_EQUAL(parts, exp_parts)
    `SVTEST_END

    `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore)
      string some_string = "string";
      string parts[] = string_utils::split_by_char("_", some_string);
      string exp_parts[] = '{ "string" };
      `FAIL_UNLESS_EQUAL(parts, exp_parts)
    `SVTEST_END

  `SVUNIT_TESTS_END

endmodule


package queue_test;

  `include "svunit.svh"
  `include "svunit_defines.svh"

  import queue::*;

  virtual class queue_test extends svunit::test;

    protected queue #(int) q0;
    protected queue #(int) q1;
    protected queue #(int) q2;

    protected virtual function void set_up();
      q1.enqueue(1);
      q2.enqueue(2);
      q2.enqueue(3);
    endfunction

  endclass

  `TEST_F_BEGIN(queue_test, is_empty_initially)
    `FAIL_UNLESS_EQUAL(q0.size(), 0)
  `TEST_F_END

  `TEST_F_BEGIN(queue_test, dequeue_works)
    `FAIL_UNLESS_EQUAL(q1.dequeue(), 1)
    `FAIL_UNLESS_EQUAL(q1.size(), 0)

    `FAIL_UNLESS_EQUAL(q2.dequeue(), 2)
    `FAIL_UNLESS_EQUAL(q2.size(), 1)
  `TEST_F_END

endpackage

Fix null pointer exceptions in test

package queue_test;

  `include "svunit.svh"
  `include "svunit_defines.svh"

  import queue::*;

  virtual class queue_test extends svunit::test;

    protected queue #(int) q0 = new();
    protected queue #(int) q1 = new();
    protected queue #(int) q2 = new();

    protected virtual function void set_up();
      q1.enqueue(1);
      q2.enqueue(2);
      q2.enqueue(3);
    endfunction

  endclass

  `TEST_F_BEGIN(queue_test, is_empty_initially)
    `FAIL_UNLESS_EQUAL(q0.size(), 0)
  `TEST_F_END

  `TEST_F_BEGIN(queue_test, dequeue_works)
    `FAIL_UNLESS_EQUAL(q1.dequeue(), 1)
    `FAIL_UNLESS_EQUAL(q1.size(), 0)

    `FAIL_UNLESS_EQUAL(q2.dequeue(), 2)
    `FAIL_UNLESS_EQUAL(q2.size(), 1)
  `TEST_F_END

endpackage


// 6.20 of svlog-2009

module A1 #(int a = 5, localparam logic b = 1, type c = int, parameter n);
	// TODO: Check that parameter port is
	// - parameter int a = 5,
	// - localparam logic b = 1,
	// - localparam type c = int,
	// - parameter n
endmodule

module A2;
	A1 #(.n(2)) a;
	// TODO: Check that
	// - a.a = non-local (int) 5
	// - a.b = local (logic) 1
	// - a.c = local type int
	// - a.n = non-local (int) 2
endmodule

class B #(size = 1);
	logic [size-1:0] v;
endclass

interface C #(AWIDTH = 64, type T = word) (input logic clk);
endinterface

module D #(int N = 5, M = N*16, type T = int, T x = 0)();
endmodule

class E #(type T, int size);
	T words[size];
endclass

typedef E#(byte, 1024) F;

Disable some weird broken tests

// 6.20 of svlog-2009

module A1 #(int a = 5, localparam logic b = 1, type c = int, parameter n);
	// TODO: Check that parameter port is
	// - parameter int a = 5,
	// - localparam logic b = 1,
	// - localparam type c = int,
	// - parameter n
endmodule

module A2;
	A1 #(.n(2)) a;
	// TODO: Check that
	// - a.a = non-local (int) 5
	// - a.b = local (logic) 1
	// - a.c = local type int
	// - a.n = non-local (int) 2
endmodule

class B #(size = 1);
	logic [size-1:0] v;
endclass

interface C #(AWIDTH = 64, type T = int) (input logic clk);
endinterface

module D #(int N = 5, M = N*16, type T = int, T x = 0)();
endmodule

// class E #(type T, int size);
// 	T words[size];
// endclass

// typedef E#(byte, 1024) F;


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// This sequence triggers prog_failure alert by setting the error bit in otp_program_rsp
// Then check in scb if the alert is triggered correctly
class lc_ctrl_prog_failure_vseq extends lc_ctrl_smoke_vseq;
  `uvm_object_utils(lc_ctrl_prog_failure_vseq)

  `uvm_object_new

  constraint otp_prog_err_c {
    otp_prog_err == 1;
  }

  virtual task post_start();
    // trigger dut_init to make sure always on alert is not firing forever
    if (do_apply_reset) begin
      dut_init();
    end else wait(0); // wait until upper seq resets and kills this seq

    // delay to avoid race condition when sending item and checking no item after reset occur
    // at the same time
    #1ps;
    super.post_start();
  endtask

endclass

Modify lc tests to use post_start alert checking.

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// This sequence triggers prog_failure alert by setting the error bit in otp_program_rsp
// Then check in scb if the alert is triggered correctly
class lc_ctrl_prog_failure_vseq extends lc_ctrl_smoke_vseq;
  `uvm_object_utils(lc_ctrl_prog_failure_vseq)

  `uvm_object_new

  constraint otp_prog_err_c {
    otp_prog_err == 1;
  }

  virtual task post_start();
    expect_fatal_alerts = 1;
    super.post_start();
  endtask

endclass


/* package private */ class string_utils;

  /* local */ typedef string array_of_string[];

  static function array_of_string split_by_char(string char, string s);
    string parts[$];
    int last_char_position = -1;

    if (char.len() != 1)
      $fatal(0, "Internal error: expected a single character string");

    for (int i = 0; i < s.len(); i++) begin
      if (i == s.len()-1)
        parts.push_back(s.substr(last_char_position+1, i));
      if (s[i] == char) begin
        parts.push_back(s.substr(last_char_position+1, i-1));
        last_char_position = i;
      end
    end

    return parts;
  endfunction

endclass

Fix warning related to string comparison

/* package private */ class string_utils;

  /* local */ typedef string array_of_string[];

  static function array_of_string split_by_char(string char, string s);
    string parts[$];
    int last_char_position = -1;

    if (char.len() != 1)
      $fatal(0, "Internal error: expected a single character string");

    for (int i = 0; i < s.len(); i++) begin
      if (i == s.len()-1)
        parts.push_back(s.substr(last_char_position+1, i));
      if (string'(s[i]) == char) begin
        parts.push_back(s.substr(last_char_position+1, i-1));
        last_char_position = i;
      end
    end

    return parts;
  endfunction

endclass


// $Id: $
// File name:   OutputControllerRAM.sv
// Created:     4/21/2016
// Author:      Diego De La Fuente
// Lab Section: 337-08
// Version:     1.0  Initial Design Entry
// Description: This is how the Output Controller reads and writes to the M9K
//

module OutputControllerRam
(
	    output reg [31:0] q,
		input [31:0] d,
		input [6:0] write_address, read_address,
		input we, clk
);
	reg [31:0] mem [2457599:0];
	always @ (posedge clk) begin
		if (we)
			mem[write_address] <= d;
		q <= mem[read_address]; // q doesn't get d in this clock cycle
	end
endmodule

Revert "Revert "Changes to Output Controller Ram Access""

// $Id: $
// File name:   OutputControllerRAM.sv
// Created:     4/21/2016
// Author:      Diego De La Fuente
// Lab Section: 337-08
// Version:     1.0  Initial Design Entry
// Description: This is how the Output Controller reads and writes to the M9K
//

module OutputControllerRam
(
	    output reg [23:0] q,
		input [23:0] data,
		input [6:0] write_address, read_address,
		input we, clk
);
	reg [23:0] mem [2457599:0];
	always @ (posedge clk) begin
		if (we)
			mem[write_address] <= data;
		q <= mem[read_address]; // q doesn't get d in this clock cycle
	end
endmodule


`define SVUNIT_INTERNAL_TEST_BEGIN(TEST_NAME, BASE_CLASS) \
  class TEST_NAME extends BASE_CLASS; \
    local static const bit is_test_builder_registerd \
        = register_test_builder(concrete_builder#(TEST_NAME)::get()); \
    local static string full_name_of_class = $sformatf("%m"); \
    \
    virtual function string full_name(); \
      return full_name_of_class; \
    endfunction \
    \
    virtual function string name(); \
      return `"TEST_NAME`"; \
    endfunction \
    \
    virtual task test_body(); \

`define SVUNIT_INTERNAL_TEST_END \
    endtask \
  endclass \

Fix access qualifier warnings when using experimental test macros

`define SVUNIT_INTERNAL_TEST_BEGIN(TEST_NAME, BASE_CLASS) \
  class TEST_NAME extends BASE_CLASS; \
    local static const bit is_test_builder_registerd \
        = register_test_builder(concrete_builder#(TEST_NAME)::get()); \
    local static string full_name_of_class = $sformatf("%m"); \
    \
    virtual function string full_name(); \
      return full_name_of_class; \
    endfunction \
    \
    virtual function string name(); \
      return `"TEST_NAME`"; \
    endfunction \
    \
    protected virtual task test_body(); \

`define SVUNIT_INTERNAL_TEST_END \
    endtask \
  endclass \


//- @my_module defines/binding _
module my_module();
    //- @y defines/binding Y
    int y = 0;
    initial begin
        //- @#0x defines/binding X
        //- @#1x ref X
        //- @#2x ref X
        for (uint x = 1; x < 5; x++) begin
            //- @y ref Y
            y++;
        end
    end
endmodule

Update test to cover variable declaration inside for-loop header.

//- @uint defines/binding Uint
typedef int uint;

//- @my_module defines/binding _
module my_module();
    //- @y defines/binding Y
    int y = 0;
    initial begin
        //- @uint ref Uint
        //- @#0x defines/binding X
        //- @#1x ref X
        //- @#2x ref X
        for (uint x = 1; x < 5; x++) begin
            //- @y ref Y
            y++;
        end
    end
endmodule


package factorial;

  function automatic int unsigned factorial(int unsigned n);
    return 0;
  endfunction

endpackage

Implement enough production code to make one test pass

package factorial;

  function automatic int unsigned factorial(int unsigned n);
    return 1;
  endfunction

endpackage


// RUN: moore %s -e foo
// IGNORE

module foo (
    .P1(x1[3:0]),
    .P2(x1[7:0]),
    .P3(x2),
    P4,
    .P5({x3, x4}),
    {x5, x6}
);
    // This language needs to die.
    output [7:0] x1;
    ref x2;
    input P4;
    input x3, x5;
    output x4, x6;
endmodule

Update complex SV ports test

// RUN: moore %s -e foo
// IGNORE

module foo (
    .P1(x1[3:0]),
    .P2(x1[7:0]),
    .P3(x2),
    P4,
    .P5({x3, x4}),
    {x5, x6}
);
    // This language needs to die.
    output [7:0] x1;
    ref x2;
    input P4;
    input x3, x5;
    output x4, x6;

    logic [7:0] x1;
    int x2;
endmodule


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Bound into the otbn_rf_base and used to help collect call stack information for coverage.

interface otbn_rf_base_if (
  input       clk_i,
  input       rst_ni,

  // Signal names from the otbn_rf_base module (where we are bound)
  input logic pop_stack_a,
  input logic pop_stack_b,
  input logic pop_stack,
  input logic push_stack,
  input logic stack_full,
  input logic stack_data_valid
);

  function automatic otbn_env_pkg::call_stack_flags_t get_call_stack_flags();
    return '{
              pop_a: pop_stack && pop_stack_a,
              pop_b: pop_stack && pop_stack_b,
              push: push_stack
            };
  endfunction

  function automatic otbn_env_pkg::stack_fullness_e get_call_stack_fullness();
    if (stack_full) begin
      return otbn_env_pkg::StackFull;
    end
    if (stack_data_valid) begin
      return otbn_env_pkg::StackPartial;
    end
    return otbn_env_pkg::StackEmpty;
  endfunction

endinterface

Fix callstack flags in coverage

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Bound into the otbn_rf_base and used to help collect call stack information for coverage.

interface otbn_rf_base_if (
  input       clk_i,
  input       rst_ni,

  // Signal names from the otbn_rf_base module (where we are bound)
  input logic pop_stack_a,
  input logic pop_stack_b,
  input logic push_stack_reqd,
  input logic stack_full,
  input logic stack_data_valid
);

  function automatic otbn_env_pkg::call_stack_flags_t get_call_stack_flags();
    return '{
              pop_a: pop_stack_a,
              pop_b: pop_stack_b,
              push: push_stack_reqd
            };
  endfunction

  function automatic otbn_env_pkg::stack_fullness_e get_call_stack_fullness();
    if (stack_full) begin
      return otbn_env_pkg::StackFull;
    end
    if (stack_data_valid) begin
      return otbn_env_pkg::StackPartial;
    end
    return otbn_env_pkg::StackEmpty;
  endfunction

endinterface


// $Id: $
// File name:   OutputControllerRAM.sv
// Created:     4/21/2016
// Author:      Diego De La Fuente
// Lab Section: 337-08
// Version:     1.0  Initial Design Entry
// Description: This is how the Output Controller reads and writes to the M9K
//

module OutputControllerRam
(
	    output reg [23:0] q,
		input [23:0] data,
		input [6:0] write_address, read_address,
		input we, clk
);
	reg [23:0] mem [2457599:0];
	always @ (posedge clk) begin
		if (we)
			mem[write_address] <= data;
		q <= mem[read_address]; // q doesn't get d in this clock cycle
	end
endmodule

Revert "Changes to Output Controller Ram Access"

// $Id: $
// File name:   OutputControllerRAM.sv
// Created:     4/21/2016
// Author:      Diego De La Fuente
// Lab Section: 337-08
// Version:     1.0  Initial Design Entry
// Description: This is how the Output Controller reads and writes to the M9K
//

module OutputControllerRam
(
	    output reg [31:0] q,
		input [31:0] d,
		input [6:0] write_address, read_address,
		input we, clk
);
	reg [31:0] mem [2457599:0];
	always @ (posedge clk) begin
		if (we)
			mem[write_address] <= d;
		q <= mem[read_address]; // q doesn't get d in this clock cycle
	end
endmodule


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class edn_alert_test extends edn_base_test;

  `uvm_component_utils(edn_alert_test)
  `uvm_component_new

  function void configure_env();
    super.configure_env();

    cfg.en_scb            = 0;
    cfg.enable_pct        = 100;
    cfg.boot_req_mode_pct = 0;
    cfg.cmd_fifo_rst      = 100;
    cfg.use_invalid_mubi  = 1;
    cfg.num_endpoints     = MIN_NUM_ENDPOINTS;

    `DV_CHECK_RANDOMIZE_FATAL(cfg)
    `uvm_info(`gfn, $sformatf("%s", cfg.convert2string()), UVM_LOW)
  endfunction
endclass : edn_alert_test

Fix ENUMERR in DV environment

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class edn_alert_test extends edn_base_test;

  `uvm_component_utils(edn_alert_test)
  `uvm_component_new

  function void configure_env();
    super.configure_env();

    cfg.en_scb            = 0;
    cfg.enable_pct        = 100;
    cfg.boot_req_mode_pct = 0;
    cfg.cmd_fifo_rst_pct  = 100;
    cfg.use_invalid_mubi  = 1;
    cfg.num_endpoints     = MIN_NUM_ENDPOINTS;

    `DV_CHECK_RANDOMIZE_FATAL(cfg)
    `uvm_info(`gfn, $sformatf("%s", cfg.convert2string()), UVM_LOW)
  endfunction
endclass : edn_alert_test


//
// Copyright 2011-2015 Jeff Bush
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

`ifndef __CONFIG_V
`define __CONFIG_V

// Configurable parameters
// Number of ways must be 1, 2, 4, or 8

`define NUM_CORES 1
`define THREADS_PER_CORE 4
`define L1D_WAYS 4
`define L1D_SETS 64		// 16k
`define L1I_WAYS 4
`define L1I_SETS 64		// 16k
`define L2_WAYS 8
`define L2_SETS 256		// 128k
`define AXI_DATA_WIDTH 32

`endif

Increase L2 cache size to 256k

//
// Copyright 2011-2015 Jeff Bush
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

`ifndef __CONFIG_V
`define __CONFIG_V

// Configurable parameters
// Number of ways must be 1, 2, 4, or 8

`define NUM_CORES 1
`define THREADS_PER_CORE 4
`define L1D_WAYS 4
`define L1D_SETS 64		// 16k
`define L1I_WAYS 4
`define L1I_SETS 64		// 16k
`define L2_WAYS 8
`define L2_SETS 512		// 256k
`define AXI_DATA_WIDTH 32

`endif


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

`include "prim_assert.sv"

module prim_generic_rom #(
  parameter  int Width     = 32,
  parameter  int Depth     = 2048, // 8kB default
  parameter  int Aw        = $clog2(Depth)
) (
  input                        clk_i,
  input                        rst_ni,
  input        [Aw-1:0]        addr_i,
  input                        cs_i,
  output logic [Width-1:0]     dout_o,
  output logic                 dvalid_o
);

  logic [Width-1:0] mem [Depth];

  always_ff @(posedge clk_i) begin
    if (cs_i) begin
      dout_o <= mem[addr_i];
    end
  end

  always_ff @(posedge clk_i or negedge rst_ni) begin
    if (!rst_ni) begin
      dvalid_o <= 1'b0;
    end else begin
      dvalid_o <= cs_i;
    end
  end

  `include "prim_util_memload.sv"

  ////////////////
  // ASSERTIONS //
  ////////////////

  // Control Signals should never be X
  `ASSERT(noXOnCsI, !$isunknown(cs_i), clk_i, '0)
endmodule

Use localparam for derived parameters

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

`include "prim_assert.sv"

module prim_generic_rom #(
  parameter  int Width     = 32,
  parameter  int Depth     = 2048, // 8kB default
  localparam int Aw        = $clog2(Depth)
) (
  input                        clk_i,
  input                        rst_ni,
  input        [Aw-1:0]        addr_i,
  input                        cs_i,
  output logic [Width-1:0]     dout_o,
  output logic                 dvalid_o
);

  logic [Width-1:0] mem [Depth];

  always_ff @(posedge clk_i) begin
    if (cs_i) begin
      dout_o <= mem[addr_i];
    end
  end

  always_ff @(posedge clk_i or negedge rst_ni) begin
    if (!rst_ni) begin
      dvalid_o <= 1'b0;
    end else begin
      dvalid_o <= cs_i;
    end
  end

  `include "prim_util_memload.sv"

  ////////////////
  // ASSERTIONS //
  ////////////////

  // Control Signals should never be X
  `ASSERT(noXOnCsI, !$isunknown(cs_i), clk_i, '0)
endmodule


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// smoke test vseq
class sysrst_ctrl_smoke_vseq extends sysrst_ctrl_base_vseq;
  `uvm_object_utils(sysrst_ctrl_smoke_vseq)

  `uvm_object_new

  constraint num_trans_c {num_trans == 20;}

  task body();
   `uvm_info(`gfn, "Starting the body from smoke_seq", UVM_LOW)

    repeat (num_trans) begin

      // Randomize the input pins
      cfg.vif.randomize_input();

      // In normal mode sysrst_ctrl should pass the input pins data to output pins as it is
      @(posedge cfg.vif.clk_i)
      `DV_CHECK_EQ(cfg.vif.key0_in, cfg.vif.key0_out)
      `DV_CHECK_EQ(cfg.vif.key1_in, cfg.vif.key1_out)
      `DV_CHECK_EQ(cfg.vif.key2_in, cfg.vif.key2_out)
      `DV_CHECK_EQ(cfg.vif.pwrb_in, cfg.vif.pwrb_out)
    end
  endtask : body

endclass : sysrst_ctrl_smoke_vseq

Add flash_wp_l_o check in smoke test

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// smoke test vseq
class sysrst_ctrl_smoke_vseq extends sysrst_ctrl_base_vseq;
  `uvm_object_utils(sysrst_ctrl_smoke_vseq)

  `uvm_object_new

  constraint num_trans_c {num_trans == 20;}

  task body();
   `uvm_info(`gfn, "Starting the body from smoke_seq", UVM_LOW)

    repeat (num_trans) begin

      // Randomize the input pins
      cfg.vif.randomize_input();

      // In normal mode sysrst_ctrl should pass the input pins data to output pins as it is
      cfg.clk_aon_rst_vif.wait_clks(1);
      `DV_CHECK_EQ(cfg.vif.key0_in, cfg.vif.key0_out)
      `DV_CHECK_EQ(cfg.vif.key1_in, cfg.vif.key1_out)
      `DV_CHECK_EQ(cfg.vif.key2_in, cfg.vif.key2_out)
      `DV_CHECK_EQ(cfg.vif.pwrb_in, cfg.vif.pwrb_out)
      // Input pin flash_wp_l_in should not affect flash_wp_l_o output pin
      `DV_CHECK_EQ(cfg.vif.flash_wp_l, 0)
    end
  endtask : body

endclass : sysrst_ctrl_smoke_vseq


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Bidirectional IO buffer for Xilinx FPGAs. Implements inversion and
// virtual open drain feature.

module prim_xilinx_pad_wrapper #(
  parameter int unsigned AttrDw = 2
) (
  inout wire         inout_io, // bidirectional pad
  output logic       in_o,     // input data
  input              out_i,    // output data
  input              oe_i,     // output enable
  // additional attributes
  input [AttrDw-1:0] attr_i
);

  // get pad attributes
  logic od, inv;
  assign {od, inv} = attr_i[1:0];

  // input inversion
  logic in;
  assign in_o     = inv ^ in;

  // virtual open drain emulation
  logic oe, out;
  assign out      = out_i ^ inv;
  assign oe       = oe_i & ((od & ~out) | ~od);

  // driver
  IOBUF i_iobuf (
    .T(oe),
    .I(out),
    .O(in),
    .IO(inout_io)
  );

endmodule : prim_xilinx_pad_wrapper

Correct OE signal polarity for Xilinx version

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Bidirectional IO buffer for Xilinx FPGAs. Implements inversion and
// virtual open drain feature.

module prim_xilinx_pad_wrapper #(
  parameter int unsigned AttrDw = 2
) (
  inout wire         inout_io, // bidirectional pad
  output logic       in_o,     // input data
  input              out_i,    // output data
  input              oe_i,     // output enable
  // additional attributes
  input [AttrDw-1:0] attr_i
);

  // get pad attributes
  logic od, inv;
  assign {od, inv} = attr_i[1:0];

  // input inversion
  logic in;
  assign in_o     = inv ^ in;

  // virtual open drain emulation
  logic oe_n, out;
  assign out      = out_i ^ inv;
  // oe_n = 0: enable driver
  // oe_n = 1: disable driver
  assign oe_n     = ~oe_i | (out & od);

  // driver
  IOBUF i_iobuf (
    .T(oe_n),
    .I(out),
    .O(in),
    .IO(inout_io)
  );

endmodule : prim_xilinx_pad_wrapper


module svunit_main;

  initial
    svunit::run_all_tests();

endmodule

Make sure test code is elaborated

module svunit_main;

  import factorial_test::*;

  initial
    svunit::run_all_tests();

endmodule


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class edn_genbits_test extends edn_base_test;

  `uvm_component_utils(edn_genbits_test)
  `uvm_component_new

  function void configure_env();
    super.configure_env();

    cfg.boot_req_mode_pct = 30;
    cfg.auto_req_mode_pct = 30;
    cfg.min_num_boot_reqs = 1;
    cfg.max_num_boot_reqs = 4;
    cfg.min_num_ep_reqs   = 4;
    cfg.max_num_ep_reqs   = 16;

    `DV_CHECK_RANDOMIZE_FATAL(cfg)
    `uvm_info(`gfn, $sformatf("%s", cfg.convert2string()), UVM_HIGH)
  endfunction
endclass : edn_genbits_test

Increase edn genbit max size

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class edn_genbits_test extends edn_base_test;

  `uvm_component_utils(edn_genbits_test)
  `uvm_component_new

  function void configure_env();
    super.configure_env();

    cfg.boot_req_mode_pct = 30;
    cfg.auto_req_mode_pct = 30;
    cfg.min_num_boot_reqs = 1;
    cfg.max_num_boot_reqs = 4;
    cfg.min_num_ep_reqs   = 4;
    cfg.max_num_ep_reqs   = 64;

    `DV_CHECK_RANDOMIZE_FATAL(cfg)
    `uvm_info(`gfn, $sformatf("%s", cfg.convert2string()), UVM_HIGH)
  endfunction
endclass : edn_genbits_test


//###########################################################################
//
//  Copyright 2011 The SVUnit Authors.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
//###########################################################################

`ifndef SVUNIT_TYPES
`define SVUNIT_TYPES

  /*
    Enum: results_t
    enumerated type containing PASS/FAIL
  */
  typedef enum {PASS=1, FAIL=0}  results_t;

  /*
    Enum: boolean_t
    enumerated type containing TRUE/FALSE
  */
  typedef enum {TRUE=1, FALSE=0} boolean_t;

`endif

Fix compile of code under test to work together with stable SVUnit

//###########################################################################
//
//  Copyright 2011-2022 The SVUnit Authors.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
//###########################################################################

  /*
    Enum: results_t
    enumerated type containing PASS/FAIL
  */
  typedef enum {PASS=1, FAIL=0}  results_t;

  /*
    Enum: boolean_t
    enumerated type containing TRUE/FALSE
  */
  typedef enum {TRUE=1, FALSE=0} boolean_t;


typedef class global_test_registry;

virtual class test;

  typedef class builder;

  protected static function bit register_test_builder(builder b, string typename);
    full_name_extraction fn_extraction = new();
    string full_name = fn_extraction.get_full_name(typename);
    global_test_registry::get().register(b, full_name);

    return 1;
  endfunction

  pure virtual function string name();

  task run();
    set_up();
    test_body();
    tear_down();
  endtask

  protected virtual task set_up();
  endtask

  protected pure virtual task test_body();

  protected virtual task tear_down();
  endtask

  virtual class builder;
    pure virtual function test create();
  endclass

  class concrete_builder #(type T = test) extends builder;
    local static concrete_builder #(T) single_instance;

    static function concrete_builder #(T) get();
      if (single_instance == null)
        single_instance = new();
      return single_instance;
    endfunction

    virtual function T create();
      T result = new();
      return result;
    endfunction
  endclass

endclass

Work around compile error due to order of qualifiers

typedef class global_test_registry;

virtual class test;

  typedef class builder;

  protected static function bit register_test_builder(builder b, string typename);
    full_name_extraction fn_extraction = new();
    string full_name = fn_extraction.get_full_name(typename);
    global_test_registry::get().register(b, full_name);

    return 1;
  endfunction

  pure virtual function string name();

  task run();
    set_up();
    test_body();
    tear_down();
  endtask

  protected virtual task set_up();
  endtask

  pure virtual protected task test_body();

  protected virtual task tear_down();
  endtask

  virtual class builder;
    pure virtual function test create();
  endclass

  class concrete_builder #(type T = test) extends builder;
    local static concrete_builder #(T) single_instance;

    static function concrete_builder #(T) get();
      if (single_instance == null)
        single_instance = new();
      return single_instance;
    endfunction

    virtual function T create();
      T result = new();
      return result;
    endfunction
  endclass

endclass


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class aon_timer_env_cfg extends cip_base_env_cfg #(.RAL_T(aon_timer_reg_block));

  virtual clk_rst_if        aon_clk_rst_vif;
  virtual pins_if #(1)      lc_escalate_en_vif;
  virtual pins_if #(2)      aon_intr_vif;
  virtual pins_if #(1)      sleep_vif;

  // ext component cfgs

  `uvm_object_utils_begin(aon_timer_env_cfg)
  `uvm_object_utils_end

  function new (string name="");
    super.new(name);

    // The aon_timer RTL doesn't support a devmode input at the moment.
    has_devmode = 1'b0;
  endfunction : new

  virtual function void initialize(bit [31:0] csr_base_addr = '1);
    list_of_alerts = aon_timer_env_pkg::LIST_OF_ALERTS;
    super.initialize(csr_base_addr);

    // set num_interrupts & num_alerts
    begin
      uvm_reg rg = ral.get_reg_by_name("intr_state");
      if (rg != null) begin
        num_interrupts = ral.intr_state.get_n_used_bits();
      end
    end
  endfunction

endclass

Set TL Outstanding Request Cap as 1

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class aon_timer_env_cfg extends cip_base_env_cfg #(.RAL_T(aon_timer_reg_block));

  virtual clk_rst_if        aon_clk_rst_vif;
  virtual pins_if #(1)      lc_escalate_en_vif;
  virtual pins_if #(2)      aon_intr_vif;
  virtual pins_if #(1)      sleep_vif;

  // ext component cfgs

  `uvm_object_utils_begin(aon_timer_env_cfg)
  `uvm_object_utils_end

  function new (string name="");
    super.new(name);

    // The aon_timer RTL doesn't support a devmode input at the moment.
    has_devmode = 1'b0;
  endfunction : new

  virtual function void initialize(bit [31:0] csr_base_addr = '1);
    list_of_alerts = aon_timer_env_pkg::LIST_OF_ALERTS;
    super.initialize(csr_base_addr);

    m_tl_agent_cfg.max_outstanding_req = 1;

    // set num_interrupts & num_alerts
    begin
      uvm_reg rg = ral.get_reg_by_name("intr_state");
      if (rg != null) begin
        num_interrupts = ral.intr_state.get_n_used_bits();
      end
    end
  endfunction

endclass


module string_utils_unit_test;

  import svunit_pkg::*;
  `include "svunit_defines.svh"

  string name = "string_utils_ut";
  svunit_testcase svunit_ut;

  import svunit_under_test::string_utils;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

    `SVTEST(can_split_string_by_underscore)
      string some_string = "some_string";
      string parts[] = string_utils::split_by_char("_", some_string);
      string exp_parts[] = '{ "some", "string" };
      `FAIL_UNLESS_EQUAL(parts, exp_parts)
    `SVTEST_END

    `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore)
      string some_string = "string";
      string parts[] = string_utils::split_by_char("_", some_string);
      string exp_parts[] = '{ "string" };
      `FAIL_UNLESS_EQUAL(parts, exp_parts)
    `SVTEST_END

  `SVUNIT_TESTS_END

endmodule

Update unit test to use updated names for SVUnit version for testing

module string_utils_unit_test;

  import svunit_stable_pkg::*;
  `include "svunit_stable_defines.svh"

  string name = "string_utils_ut";
  svunit_testcase svunit_ut;

  import svunit_under_test::string_utils;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

    `SVTEST(can_split_string_by_underscore)
      string some_string = "some_string";
      string parts[] = string_utils::split_by_char("_", some_string);
      string exp_parts[] = '{ "some", "string" };
      `FAIL_UNLESS_EQUAL(parts, exp_parts)
    `SVTEST_END

    `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore)
      string some_string = "string";
      string parts[] = string_utils::split_by_char("_", some_string);
      string exp_parts[] = '{ "string" };
      `FAIL_UNLESS_EQUAL(parts, exp_parts)
    `SVTEST_END

  `SVUNIT_TESTS_END

endmodule


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Dummy clock gating module

module prim_clock_gating #(
    parameter Impl = "default"
) (
    input        clk_i,
    input        en_i,
    input        test_en_i,
    output logic clk_o
);

  assign clk_o = en_i ? clk_i : 0;

endmodule

Make dummy clock gating module compatible with latch-based reg file

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Dummy clock gating module compatible with latch-based register file

module prim_clock_gating #(
    parameter Impl = "default"
) (
    input        clk_i,
    input        en_i,
    input        test_en_i,
    output logic clk_o
);

  logic clk_en;

  always_latch begin
    if (clk_i == 1'b0) begin
      clk_en <= en_i | test_en_i;
    end
  end

  assign clk_o = clk_i & clk_en;

endmodule


class my_driver extends uvm_driver #(my_item);
    virtual my_interface vif;

    `uvm_component_utils(my_driver)
    function new(string name="my_driver", uvm_component parent=null);
        super.new(name, parent);
    endfunction

    virtual function void connect_phase(uvm_phase phase);
        super.connect_phase(phase);
        assert (uvm_config_db#(virtual my_interface)::get(this, "", "ifc", vif) && vif != null)
        else `uvm_fatal("DRIVER_VIF_NOT_FOUND", "Did not find virtual my_interface 'vif' in the uvm_config_db")
    endfunction

    virtual task run_phase(uvm_phase phase);
        super.run_phase(phase);
        fork drive_thread(); join_none
    endtask

    virtual task drive_thread();
        forever begin
            #1;
            seq_item_port.get(req); // seq_item_port and req are inherited from uvm_driver
            vif.foo = req.foo;
        end
    endtask
endclass

Use proper get_next_item()/item_done() calls in driver example.

class my_driver extends uvm_driver #(my_item);
    virtual my_interface vif;

    `uvm_component_utils(my_driver)
    function new(string name="my_driver", uvm_component parent=null);
        super.new(name, parent);
    endfunction

    virtual function void connect_phase(uvm_phase phase);
        super.connect_phase(phase);
        assert (uvm_config_db#(virtual my_interface)::get(this, "", "ifc", vif) && vif != null)
        else `uvm_fatal("DRIVER_VIF_NOT_FOUND", "Did not find virtual my_interface 'vif' in the uvm_config_db")
    endfunction

    virtual task run_phase(uvm_phase phase);
        super.run_phase(phase);
        fork drive_thread(); join_none
    endtask

    virtual task drive_thread();
        forever begin
            #1;
            seq_item_port.get_next_item(req); // seq_item_port and req are inherited from uvm_driver
            vif.foo = req.foo;
            seq_item_port.item_done();
        end
    endtask
endclass


module equals_macros_example_unit_test;

  import svunit_pkg::svunit_testcase;
  `include "svunit_defines.svh"

  string name = "equals_macros_example_ut";
  svunit_testcase svunit_ut;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

  `SVTEST(fail_unless_equal__int_variables)
    int one = 1;
    int two = 2;
    `FAIL_UNLESS_EQUAL(one, two);
  `SVTEST_END

  `SVTEST(fail_unless_equal__int_variable_and_int_constant)
    int one = 1;
    `FAIL_UNLESS_EQUAL(one, 2);
  `SVTEST_END

  `SVTEST(fail_unless_equal__int_function_and_int_constant)
    `FAIL_UNLESS_EQUAL(function_returning_one(), 2);
  `SVTEST_END

  `SVUNIT_TESTS_END

  function int function_returning_one();
    return 1;
  endfunction

endmodule

Add example with usage of `FAIL_IF_EQUAL`

module equals_macros_example_unit_test;

  import svunit_pkg::svunit_testcase;
  `include "svunit_defines.svh"

  string name = "equals_macros_example_ut";
  svunit_testcase svunit_ut;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

  `SVTEST(fail_unless_equal__int_variables)
    int one = 1;
    int two = 2;
    `FAIL_UNLESS_EQUAL(one, two);
  `SVTEST_END

  `SVTEST(fail_unless_equal__int_variable_and_int_constant)
    int one = 1;
    `FAIL_UNLESS_EQUAL(one, 2);
  `SVTEST_END

  `SVTEST(fail_unless_equal__int_function_and_int_constant)
    `FAIL_UNLESS_EQUAL(function_returning_one(), 2);
  `SVTEST_END

  `SVTEST(fail_if_equal__int_variables)
    int one = 1;
    int also_one = 1;
    `FAIL_IF_EQUAL(one, also_one);
  `SVTEST_END

  `SVUNIT_TESTS_END

  function int function_returning_one();
    return 1;
  endfunction

endmodule


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

`ifndef __OTBN_MEMUTIL_SVH__
`define __OTBN_MEMUTIL_SVH__

// Imports for the functions defined in otbn_memutil.h. There are documentation comments explaining
// what the functions do there.

import "DPI-C" function chandle OtbnMemUtilMake(string top_scope);

import "DPI-C" function void OtbnMemUtilFree(chandle mem_util);

import "DPI-C" function bit OtbnMemUtilLoadElf(chandle mem_util, string elf_path);

import "DPI-C" function bit OtbnMemUtilStageElf(chandle mem_util, string elf_path);

import "DPI-C" function int OtbnMemUtilGetSegCount(chandle mem_util, bit is_imem);

import "DPI-C" function bit OtbnMemUtilGetSegInfo(chandle mem_util, bit is_imem, int seg_idx,
                                                  output bit [31:0] seg_off,
                                                  output bit [31:0] seg_size);

import "DPI-C" function bit OtbnMemUtilGetSegData(chandle mem_util, bit is_imem, int word_off,
                                                  output bit[31:0] data_value);

`endif // __OTBN_MEMUTIL_SVH__

Add missing context keyword to DPI declaration

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

`ifndef __OTBN_MEMUTIL_SVH__
`define __OTBN_MEMUTIL_SVH__

// Imports for the functions defined in otbn_memutil.h. There are documentation comments explaining
// what the functions do there.

import "DPI-C" function chandle OtbnMemUtilMake(string top_scope);

import "DPI-C" function void OtbnMemUtilFree(chandle mem_util);

import "DPI-C" context function bit OtbnMemUtilLoadElf(chandle mem_util, string elf_path);

import "DPI-C" function bit OtbnMemUtilStageElf(chandle mem_util, string elf_path);

import "DPI-C" function int OtbnMemUtilGetSegCount(chandle mem_util, bit is_imem);

import "DPI-C" function bit OtbnMemUtilGetSegInfo(chandle mem_util, bit is_imem, int seg_idx,
                                                  output bit [31:0] seg_off,
                                                  output bit [31:0] seg_size);

import "DPI-C" function bit OtbnMemUtilGetSegData(chandle mem_util, bit is_imem, int word_off,
                                                  output bit[31:0] data_value);

`endif // __OTBN_MEMUTIL_SVH__


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class kmac_common_vseq extends kmac_base_vseq;
  `uvm_object_utils(kmac_common_vseq)

  constraint num_trans_c {
    num_trans inside {[1:2]};
  }
  `uvm_object_new

  virtual task pre_start();
    do_kmac_init = 1'b0;
    entropy_mode_c.constraint_mode(0);
    super.pre_start();
  endtask

  virtual task body();
    run_common_vseq_wrapper(num_trans);
  endtask : body

endclass

Fix shadow reg error due to locked regwen

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class kmac_common_vseq extends kmac_base_vseq;
  `uvm_object_utils(kmac_common_vseq)

  constraint num_trans_c {
    num_trans inside {[1:2]};
  }
  `uvm_object_new

  virtual task pre_start();
    do_kmac_init = 1'b0;
    entropy_mode_c.constraint_mode(0);
    super.pre_start();
  endtask

  virtual task body();
    run_common_vseq_wrapper(num_trans);
  endtask : body

  virtual function void predict_shadow_reg_status(bit predict_update_err  = 0,
                                                  bit predict_storage_err = 0);
    super.predict_shadow_reg_status(predict_update_err, predict_storage_err);

    if (predict_storage_err) begin
      // For storage error, the kmac `cfg_regwen` register will be set to 0 internally to lock all
      // cfg related CSRs. Because it is a `RO` register, the logic below manually locks the write
      // access for its lockable register fields. (If the regwen is `W0C` access policy, the
      // lockable fields will be updated automatically in `do_predict` function)
      ral.cfg_regwen.en.set_lockable_flds_access(.lock(1));

      // TODO(Issue #8460) - shadow storage error will clear update error status bit.
      foreach (cfg.shadow_update_err_status_fields[status_field]) begin
        void'(status_field.predict(~cfg.shadow_update_err_status_fields[status_field]));
      end
    end
  endfunction
endclass


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

module otbn_bind;

  bind otbn tlul_assert #(
    .EndpointType("Device")
  ) tlul_checker (
    .clk_i  (clk_i),
    .rst_ni (rst_ni),
    .h2d    (tl_i),
    .d2h    (tl_o)
  );

  import otbn_reg_pkg::*;
  bind otbn otbn_csr_assert_fpv csr_checker (
    .clk_i  (clk_i),
    .rst_ni (rst_ni),
    .h2d    (tl_i),
    .d2h    (tl_o),
    .reg2hw (reg2hw),
    .hw2reg (reg2hw)
  );

endmodule

Fix typo in SVA bindings

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

module otbn_bind;

  bind otbn tlul_assert #(
    .EndpointType("Device")
  ) tlul_checker (
    .clk_i  (clk_i),
    .rst_ni (rst_ni),
    .h2d    (tl_i),
    .d2h    (tl_o)
  );

  import otbn_reg_pkg::*;
  bind otbn otbn_csr_assert_fpv csr_checker (
    .clk_i  (clk_i),
    .rst_ni (rst_ni),
    .h2d    (tl_i),
    .d2h    (tl_o),
    .reg2hw (reg2hw),
    .hw2reg (hw2reg)
  );

endmodule


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class ibex_icache_ecc_driver
  extends dv_base_driver #(.ITEM_T (ibex_icache_ecc_item),
                           .CFG_T  (ibex_icache_ecc_agent_cfg));

  `uvm_component_utils(ibex_icache_ecc_driver)
  `uvm_component_new

  virtual task reset_signals();
    cfg.vif.reset();
  endtask

  virtual task get_and_drive();
    forever begin
      seq_item_port.get_next_item(req);
      `uvm_info(`gfn, $sformatf("rcvd item:\n%0s", req.sprint()), UVM_LOW)

      cfg.vif.wait_reads(req.delay);
      if (req.two_bits) begin
        cfg.vif.corrupt_read_1(req.bit_pos0);
      end else begin
        cfg.vif.corrupt_read_2(req.bit_pos0, req.bit_pos1);
      end

      seq_item_port.item_done();
    end
  endtask

endclass

Fix verbosity in ECC UVM driver

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

class ibex_icache_ecc_driver
  extends dv_base_driver #(.ITEM_T (ibex_icache_ecc_item),
                           .CFG_T  (ibex_icache_ecc_agent_cfg));

  `uvm_component_utils(ibex_icache_ecc_driver)
  `uvm_component_new

  virtual task reset_signals();
    cfg.vif.reset();
  endtask

  virtual task get_and_drive();
    forever begin
      seq_item_port.get_next_item(req);
      `uvm_info(`gfn, $sformatf("rcvd item:\n%0s", req.sprint()), UVM_HIGH)

      cfg.vif.wait_reads(req.delay);
      if (req.two_bits) begin
        cfg.vif.corrupt_read_1(req.bit_pos0);
      end else begin
        cfg.vif.corrupt_read_2(req.bit_pos0, req.bit_pos1);
      end

      seq_item_port.item_done();
    end
  endtask

endclass


Add examples with usage of `FAIL_UNLESS_EQUAL`

module equals_macros_example_unit_test;

  import svunit_pkg::svunit_testcase;
  `include "svunit_defines.svh"

  string name = "equals_macros_example_ut";
  svunit_testcase svunit_ut;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

  `SVTEST(fail_unless_equal__int_variables)
    int one = 1;
    int two = 2;
    `FAIL_UNLESS_EQUAL(one, two);
  `SVTEST_END

  `SVTEST(fail_unless_equal__int_variable_and_int_constant)
    int one = 1;
    `FAIL_UNLESS_EQUAL(one, 2);
  `SVTEST_END

  `SVTEST(fail_unless_equal__int_function_and_int_constant)
    `FAIL_UNLESS_EQUAL(function_returning_one(), 2);
  `SVTEST_END

  `SVUNIT_TESTS_END

  function int function_returning_one();
    return 1;
  endfunction

endmodule


// Copyright 2016 Tudor Timisescu (verificationgentleman.com)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

module sequencer_stub_unit_test;
  import svunit_pkg::svunit_testcase;
  `include "svunit_defines.svh"

  import vgm_svunit_utils::*;

  string name = "sequencer_stub_ut";
  svunit_testcase svunit_ut;

  class dummy_item;
  endclass

  sequencer_stub #(dummy_item) seqr;

  function void build();
    svunit_ut = new(name);

    seqr = new("sequencer_stub_unit_test_seqr", null);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

    `SVTEST(check_code_compiles)
      // Try compiling with desired UVM version.
    `SVTEST_END

  `SVUNIT_TESTS_END

endmodule


// RUN: moore %s -e foo
// IGNORE

module foo (
    .P1(x1[3:0]),
    .P2(x1[7:0]),
    .P3(x2),
    P4,
    .P5({x3, x4}),
    {x5, x6}
);
    // This language needs to die.
    output [7:0] x1;
    ref x2;
    input P4;
    input x3, x5;
    output x4, x6;
endmodule


Add test module which will contain tests for `string_utils`

module string_utils_unit_test;

  import svunit_pkg::*;
  `include "svunit_defines.svh"

  string name = "string_utils_ut";
  svunit_testcase svunit_ut;

  import svunit_under_test::string_utils;

  function void build();
    svunit_ut = new(name);
  endfunction

  task setup();
    svunit_ut.setup();
  endtask

  task teardown();
    svunit_ut.teardown();
  endtask

  `SVUNIT_TESTS_BEGIN

    `SVTEST(some_passing_test)
      `FAIL_UNLESS(svunit_under_test::TRUE)
    `SVTEST_END

  `SVUNIT_TESTS_END

endmodule


// Copyright (c) 2006- Facebook
// Distributed under the Thrift Software License
//
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/

namespace cpp apache.thrift
namespace php thrift
namespace py apache.thrift.dynamic

cpp_include "thrift/lib/thrift/SerializableDynamic.h"

union Dynamic {
  1: bool boolean;
  2: i64 integer;
  3: double doubl;
  4: binary str;
  5: list<Dynamic> arr;
  6: map<string, Dynamic> object;
} (cpp.type = "::apache::thrift::SerializableDynamic")

Move cpp.type from union to typedef

// Copyright (c) 2006- Facebook
// Distributed under the Thrift Software License
//
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/

namespace cpp apache.thrift
namespace php thrift
namespace py apache.thrift.dynamic

cpp_include "thrift/lib/thrift/SerializableDynamic.h"

union DynamicType {
  1: bool boolean;
  2: i64 integer;
  3: double doubl;
  4: binary str;
  5: list<Dynamic> arr;
  6: map<string, Dynamic> object;
}

typedef DynamicType
  (cpp.type = "::apache::thrift::SerializableDynamic") Dynamic


namespace java tachyon.thrift

include "common.thrift"
include "exception.thrift"

struct PartitionInfo {
  1: binary keyStart
  2: binary keyLimit
  3: i64 blockId
}

/**
 * This interface contains key-value master service endpoints for Tachyon clients.
 */
service KeyValueMasterClientService extends common.TachyonService {

  /**
   * Marks a partition complete and add it to the store.
   */
  void completePartition( /** the path of the store */  1: string path,
      /** the path of the store */ 2: PartitionInfo info)
    throws (1: exception.TachyonTException e)

  /**
   * Marks a store complete with its filesystem path.
   */
  void completeStore( /** the path of the store */ 1: string path)
    throws (1: exception.TachyonTException e)

  /**
   * Creates a new key-value store on master.
   */
  void createStore( /** the path of the store */  1: string path)
    throws (1: exception.TachyonTException e)

  /**
   * Gets a list of partition information given a filesystem path.
   */
  list<PartitionInfo> getPartitionInfo( /** the path of the store */ 1: string path)
    throws (1: exception.TachyonTException e)
}

Add javadoc in thrift definition

namespace java tachyon.thrift

include "common.thrift"
include "exception.thrift"

/**
 * Information of each key-value partition.
 */
struct PartitionInfo {
  1: binary keyStart
  2: binary keyLimit
  3: i64 blockId
}

/**
 * This interface contains key-value master service endpoints for Tachyon clients.
 */
service KeyValueMasterClientService extends common.TachyonService {

  /**
   * Marks a partition complete and adds it to the store.
   */
  void completePartition( /** the path of the store */  1: string path,
      /** the path of the store */ 2: PartitionInfo info)
    throws (1: exception.TachyonTException e)

  /**
   * Marks a store complete with its filesystem path.
   */
  void completeStore( /** the path of the store */ 1: string path)
    throws (1: exception.TachyonTException e)

  /**
   * Creates a new key-value store on master.
   */
  void createStore( /** the path of the store */  1: string path)
    throws (1: exception.TachyonTException e)

  /**
   * Gets a list of partition information given a filesystem path.
   */
  list<PartitionInfo> getPartitionInfo( /** the path of the store */ 1: string path)
    throws (1: exception.TachyonTException e)
}


/**
 * Copyright (c) 2013-present, Facebook, Inc.
 */
namespace cpp2 facebook.network.thrift
namespace cpp facebook.network.thrift
namespace py facebook.network.Address
namespace d facebook.network.Address

# fbstring uses the small internal buffer to store the data
# if the data is small enough (< 24 bytes).
typedef binary (cpp.type = "::folly::fbstring") fbbinary

enum AddressType {
  VUNSPEC = 0,
  V4 = 1,
  V6 = 2,
}

struct Address {
  1: required string addr,
  2: required AddressType type,
  3: optional i64 port = 0,
}

struct BinaryAddress {
  1: required fbbinary addr,
  2: optional i64 port = 0,
  3: optional string ifName,
}

Cut D support from assorted .thrift files

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 */
namespace cpp2 facebook.network.thrift
namespace cpp facebook.network.thrift
namespace py facebook.network.Address

# fbstring uses the small internal buffer to store the data
# if the data is small enough (< 24 bytes).
typedef binary (cpp.type = "::folly::fbstring") fbbinary

enum AddressType {
  VUNSPEC = 0,
  V4 = 1,
  V6 = 2,
}

struct Address {
  1: required string addr,
  2: required AddressType type,
  3: optional i64 port = 0,
}

struct BinaryAddress {
  1: required fbbinary addr,
  2: optional i64 port = 0,
  3: optional string ifName,
}


/*
kms-interface: Thrift interfaces for mediaserver
Copyright (C) 2013 Tikal Technologies

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

namespace java com.kurento.kms.api
namespace cpp kurento
namespace * Kurento

include "mediaServer.thrift"

struct KmsEvent {
  1: binary event,
  2: mediaServer.MediaObject source,
}

struct KmsError {
  1: binary error,
  2: mediaServer.MediaObject source,
}

service HandlerService {
  void onError (1: KmsError error);
  void onEvent (1: KmsEvent event);
}

Change KmsError and KmsEvent prefix to MediaError and MediaEvent

/*
kms-interface: Thrift interfaces for mediaserver
Copyright (C) 2013 Tikal Technologies

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

namespace java com.kurento.kms.api
namespace cpp kurento
namespace * Kurento

include "mediaServer.thrift"

struct MediaEvent {
  1: binary event,
  2: mediaServer.MediaObject source,
}

struct MediaError {
  1: binary error,
  2: mediaServer.MediaObject source,
}

service HandlerService {
  void onError (1: MediaError error);
  void onEvent (1: MediaEvent event);
}


/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// This file defines meta-annotations targeted at Thrift framework authors
// rather than general Thrift users.

include "thrift/annotation/scope.thrift"
include "thrift/annotation/thrift.thrift"

package "facebook.com/thrift/annotation/deprecated"

namespace java com.facebook.thrift.annotation_deprecated.deprecated
namespace py.asyncio facebook_thrift_asyncio.annotation.meta
namespace go thrift.annotation.meta
namespace py thrift.annotation.meta

// Calls t_struct::set_generated().
//
// Useful for testing.
// TODO(afuller): Move to internal.thrift.
@scope.Struct
@thrift.Experimental
struct SetGenerated {} (
  thrift.uri = "facebook.com/thrift/annotation/SetGenerated",
)

Revert D40922406: Multisect successfully blamed D40922406 for test or build failures

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// This file defines meta-annotations targeted at Thrift framework authors
// rather than general Thrift users.

include "thrift/annotation/scope.thrift"
include "thrift/annotation/thrift.thrift"

package "facebook.com/thrift/annotation/deprecated"

namespace java com.facebook.thrift.annotation_deprecated.deprecated
namespace py.asyncio facebook_thrift_asyncio.annotation.meta
namespace go thrift.annotation.meta
namespace py thrift.annotation.meta

// Calls t_struct::set_generated().
//
// Useful for testing.
// TODO(afuller): Move to internal.thrift.
@scope.Struct
@thrift.Experimental
struct SetGenerated {} (
  thrift.uri = "facebook.com/thrift/annotation/SetGenerated",
)

// TODO(afuller): Delete.
@scope.Struct
@thrift.Deprecated
struct Transitive {} (thrift.uri = "facebook.com/thrift/annotation/Transitive")


namespace * com.kurento.kms.api

include "common.thrift"
include "mediaSession.thrift"

struct ServerConfig {
	1: optional i32 mediaSessionServicePort,
	2: optional i32 networkConnectionServicePort,
	3: optional i32 mixerServicePort,
}

service MediaServerService {
	/**
	 * Gets current server configuration that may be usefull for clients
	 */
	ServerConfig getServerconfig(),

	/**
	 * Creates a new mediaSession that allows interaction with media server
	 */
	mediaSession.MediaSession createMediaSession() throws (1: common.MediaServerException mse),

	/**
	 * Deletes a previously created media session.
	 */
	void deleteMediaSession(1: mediaSession.MediaSession session) throws (1: mediaSession.MediaSessionNotFoundException msnfe),
}

Add serverService port to ServerConfig

namespace * com.kurento.kms.api

include "common.thrift"
include "mediaSession.thrift"

struct ServerConfig {
	1: optional i32 mediaSessionServicePort,
	2: optional i32 networkConnectionServicePort,
	3: optional i32 mixerServicePort,
	4: optional i32 serverServicePort,
}

service MediaServerService {
	/**
	 * Gets current server configuration that may be usefull for clients
	 */
	ServerConfig getServerconfig(),

	/**
	 * Creates a new mediaSession that allows interaction with media server
	 */
	mediaSession.MediaSession createMediaSession() throws (1: common.MediaServerException mse),

	/**
	 * Deletes a previously created media session.
	 */
	void deleteMediaSession(1: mediaSession.MediaSession session) throws (1: mediaSession.MediaSessionNotFoundException msnfe),
}


namespace cpp2 test.frozen2

struct StructA {
  1: i32 i32Field,
  2: string strField,
  5: list<hash_map<i32, string>> listField
}

Remove use of hash_map in Frozen2ProtocolTest

namespace cpp2 test.frozen2

typedef map<i32, string> (cpp.template = 'std::unordered_map') HashMapI32String

struct StructA {
  1: i32 i32Field,
  2: string strField,
  5: list<HashMapI32String> listField
}


namespace cpp2 example.chatroom

struct Message {
  1: string message
  2: string sender
  3: i64 timestamp
}

struct IndexToken {
  1: i64 index
}

struct GetMessagesRequest {
  // This token is a pointer into the messages queue that the server maintains,
  // and it marks a particular client's place in the queue. Hence, if you have
  // 10 messages in the queue, and the token's index is 5, then the client
  // has already received messages 0-5.
  1: optional IndexToken token
}

struct GetMessagesResponse {
  1: list<Message> messages
  2: IndexToken token
}

struct SendMessageRequest {
  1: string message
  2: string sender
}

exception Exception {
  1: string message
}

service ChatRoomService {
  /**
   * Initialize the service
   */
  void initialize() throws (1: Exception e)

  /**
   * Get the last few chat messages
   */
  GetMessagesResponse getMessages(1: GetMessagesRequest req)
    throws (1: Exception e)

  /**
   * Send a message
   */
  void sendMessage(1: SendMessageRequest req) throws (1: Exception e)
}

service Echo {
 /**
  * Echo back the message
  */
  string echo(1: string message)
}

Implement test binary for threadsafe clients

/*
 * Copyright 2019-present Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace cpp2 example.chatroom
namespace go   example.if.chatroom

struct Message {
  1: string message
  2: string sender
  3: i64 timestamp
}

struct IndexToken {
  1: i64 index
}

struct GetMessagesRequest {
  // This token is a pointer into the messages queue that the server maintains,
  // and it marks a particular client's place in the queue. Hence, if you have
  // 10 messages in the queue, and the token's index is 5, then the client
  // has already received messages 0-5.
  1: optional IndexToken token
}

struct GetMessagesResponse {
  1: list<Message> messages
  2: IndexToken token
}

struct SendMessageRequest {
  1: string message
  2: string sender
}

exception Exception {
  1: string message
}

service ChatRoomService {
  /**
   * Initialize the service
   */
  void initialize() throws (1: Exception e)

  /**
   * Get the last few chat messages
   */
  GetMessagesResponse getMessages(1: GetMessagesRequest req)
    throws (1: Exception e)

  /**
   * Send a message
   */
  void sendMessage(1: SendMessageRequest req) throws (1: Exception e)
}

service Echo {
 /**
  * Echo back the message
  */
  string echo(1: string message)
}


namespace java com.jetbrains.python.profiler

struct FuncStat {
  1: required string file,       // File name of the executed function
  2: optional i32 line,    	  // Line number of the executed function
  3: required string func_name,	  // Name of the executed function
  4: required i32 calls_count,	  // number of times the executed function is called.
  5: required double total_time,	  // total time spent in the executed function. See Clock Types to interpret this value correctly.
  6: required double own_time,     // total time spent in the executed function, excluding subcalls. See Clock Types to interpret this value correctly.
}

struct Function {
   1: required FuncStat func_stat,
   2: optional list<FuncStat> callers,    // list of functions called from the executed function.
}

struct Stats {
  1: required list<Function> func_stats
}

struct CallTreeStat {
  1: required i32 count,
  2: required string name,
  3: required list<CallTreeStat> children,
}

struct TreeStats {
  1: required double sampling_interval,
  2: optional CallTreeStat call_tree,
}

struct Stats_Req {}

struct SaveSnapshot_Req {
  1: required string filepath
}

struct ProfilerRequest {
  1: required i32 id,
  2: optional Stats_Req ystats,
  3: optional SaveSnapshot_Req save_snapshot,
}

struct ProfilerResponse {
  1: required i32 id,
  2: optional Stats ystats,
  3: optional TreeStats tree_stats,
  4: optional string snapshot_filepath,
}

Fix building profile call graph (PY-19862)

namespace java com.jetbrains.python.profiler

struct FuncStat {
  1: required string file,       // File name of the executed function
  2: optional i32 line,    	  // Line number of the executed function
  3: required string func_name,	  // Name of the executed function
  4: required i32 calls_count,	  // number of times the executed function is called.
  5: required double total_time,	  // total time spent in the executed function. See Clock Types to interpret this value correctly.
  6: required double own_time,     // total time spent in the executed function, excluding subcalls. See Clock Types to interpret this value correctly.
}

struct Function {
   1: required FuncStat func_stat,
   2: required list<FuncStat> callers,    // list of functions called from the executed function.
}

struct Stats {
  1: required list<Function> func_stats
}

struct CallTreeStat {
  1: required i32 count,
  2: required string name,
  3: required list<CallTreeStat> children,
}

struct TreeStats {
  1: required double sampling_interval,
  2: optional CallTreeStat call_tree,
}

struct Stats_Req {}

struct SaveSnapshot_Req {
  1: required string filepath
}

struct ProfilerRequest {
  1: required i32 id,
  2: optional Stats_Req ystats,
  3: optional SaveSnapshot_Req save_snapshot,
}

struct ProfilerResponse {
  1: required i32 id,
  2: optional Stats ystats,
  3: optional TreeStats tree_stats,
  4: optional string snapshot_filepath,
}


namespace java thrift_solr
namespace py thrift_solr
namespace perl thrift_solr

service SolrService {
   map< string, i32 > media_counts( 1:string q, 2:string facet_field, 3:list<string> fq, 4:i32 mincount )
}

Add thrift service for python-readability.

namespace java thrift_solr
namespace py thrift_solr
namespace perl thrift_solr

service SolrService {
   map< string, i32 > media_counts( 1:string q, 2:string facet_field, 3:list<string> fq, 4:i32 mincount )
}

service ExtractorService
{
   list< string >  extract_html( 1:string raw_html )
}


include "common/fb303/if/fb303.thrift"

namespace cpp apache.thrift.test

service TEventServerTestService {
  string sendResponse(1:i64 size)

  void noop()
}

Cut dead fb303 dep from TEventServer test


// Copyright (c) 2006- Facebook
// Distributed under the Thrift Software License
//
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/

namespace cpp apache.thrift
namespace php thrift
namespace py apache.thrift.dynamic
namespace py.asyncio apache.asyncio.thrift.dynamic
namespace java.swift org.apache.thrift.dynamic

cpp_include "thrift/lib/thrift/SerializableDynamic.h"

union Dynamic {
  1: bool boolean;
  2: i64 integer;
  3: double doubl;
  4: binary str;
  5: list<Dynamic> arr;
  6: map<string, Dynamic> object;
}

typedef Dynamic (cpp.type = "::apache::thrift::SerializableDynamic") DynamicType

Add py3 support for Dynamic

// Copyright (c) 2006- Facebook
// Distributed under the Thrift Software License
//
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/

namespace cpp apache.thrift
namespace php thrift
namespace py apache.thrift.dynamic
namespace py.asyncio apache.asyncio.thrift.dynamic
namespace py3 apache.thrift
namespace java.swift org.apache.thrift.dynamic

cpp_include "thrift/lib/thrift/SerializableDynamic.h"

union Dynamic {
  1: bool boolean;
  2: i64 integer;
  3: double doubl;
  4: binary str;
  5: list<Dynamic> arr;
  6: map<string, Dynamic> object;
}

typedef Dynamic (cpp.type = "::apache::thrift::SerializableDynamic") DynamicType


/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace java org.apache.tajo.yarn.thrift

service TajoYarnService {
  // add a number of tajo workers to the cluster
  void addWorker(1: i32 number);

  // add a number of tajo workers to the cluster
  void removeWorker(1: i32 number);

  // shutdown the cluster
  void shutdown();

  // add a number of querymasters to the cluster
  void addQueryMaster(1: i32 number);

  // decomission a number of queryMasters from the cluster
  void removeQueryMaster(1: i32 number);

  // add a number of taskrunners to the cluster
  void addTaskRunners(1: i32 number);

  // decomission a number of taskrunners from the cluster
  void removeTaskRunners(1: i32 number);

}

Correct the comment on thrift service removeWorker()

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace java org.apache.tajo.yarn.thrift

service TajoYarnService {
  // add a number of tajo workers to the cluster
  void addWorker(1: i32 number);

  // decommission a number of tajo workers from the cluster
  void removeWorker(1: i32 number);

  // shutdown the cluster
  void shutdown();

  // add a number of querymasters to the cluster
  void addQueryMaster(1: i32 number);

  // decomission a number of queryMasters from the cluster
  void removeQueryMaster(1: i32 number);

  // add a number of taskrunners to the cluster
  void addTaskRunners(1: i32 number);

  // decomission a number of taskrunners from the cluster
  void removeTaskRunners(1: i32 number);

}


include "common.thrift"

namespace * com.kurento.kms.api

/**
 * Default timeout is one minute
 */
const i32 DEFAULT_TIMEOUT = 60;

typedef i32 ObjectId

struct MediaObject {
	1: ObjectId id,
}

exception MediaObjectNotFoundException {
}

service MediaObjectService {
	/**
	 * Notifies the remote party that an object is already in use
	 *
	 * @param objectId The object identifier
	 * @param timeout The time until other timeout is required (in seconds)
	 */
	void ping(1: MediaObject mediaObject, 2: i32 timeout = DEFAULT_TIMEOUT) throws (1: MediaObjectNotFoundException monf),

	/**
	 * Releases the given media object
	 *
	 * @param mediaObject The mediaObject that will be released
	 */
	void release(1: MediaObject mediaObject) throws (1: MediaObjectNotFoundException monf),
}

Change the size of object identifier to 64 bits

include "common.thrift"

namespace * com.kurento.kms.api

/**
 * Default timeout is one minute
 */
const i32 DEFAULT_TIMEOUT = 60;

typedef i64 ObjectId

struct MediaObject {
	1: ObjectId id,
}

exception MediaObjectNotFoundException {
}

service MediaObjectService {
	/**
	 * Notifies the remote party that an object is already in use
	 *
	 * @param objectId The object identifier
	 * @param timeout The time until other timeout is required (in seconds)
	 */
	void ping(1: MediaObject mediaObject, 2: i32 timeout = DEFAULT_TIMEOUT) throws (1: MediaObjectNotFoundException monf),

	/**
	 * Releases the given media object
	 *
	 * @param mediaObject The mediaObject that will be released
	 */
	void release(1: MediaObject mediaObject) throws (1: MediaObjectNotFoundException monf),
}


namespace * com.kurento.kms.api

include "joinable.thrift"

struct JoinableContainer {
	1: required joinable.Joinable parent;
}

service JoinableContainerService extends joinable.JoinableService {
	// TODO: Add methods here
}

Add stream manipulation methods in joinable container

namespace * com.kurento.kms.api

include "joinable.thrift"

struct JoinableContainer {
	1: required joinable.Joinable parent;
}

exception JoinableContainerNotFoundException {
}

struct JoinableStream {
	1: required joinable.Joinable paren;
}

exception JoinableStreamNotFoundException {
}

enum StreamType {
	AUDIO,
	VIDEO,
}

service JoinableContainerService extends joinable.JoinableService {
	JoinableStream getJoinableStream(1: JoinableContainer container, 2: StreamType value) throws (1: JoinableContainerNotFoundException jcnfs, 2: JoinableStreamNotFoundException jsnf);

	list<JoinableStream> getJoinableStreams(1: JoinableContainer container) throws (1: JoinableContainerNotFoundException jcnfs);
}

service JoinableStreamService extends joinable.JoinableService {
	JoinableContainer getContainer(1: JoinableStream stream) throws (1: JoinableStreamNotFoundException jsnf);

	StreamType getType(1: JoinableStream stream) throws (1: JoinableStreamNotFoundException jsnf);
}


namespace * com.kurento.kms.api

include "common.thrift"
include "mediaSession.thrift"

service MediaServerService {
	/**
	 * Creates a new mediaSession that allows interaction with media server
	 */
	mediaSession.MediaSession createMediaSession() throws (1: common.MediaServerException mse),

	/**
	 * Deletes a previously created media session.
	 */
	void deleteMediaSession(1: mediaSession.MediaSession session) throws (1: mediaSession.MediaSessionNotFoundException msnfe),
}

Add method to known server configuration

namespace * com.kurento.kms.api

include "common.thrift"
include "mediaSession.thrift"

struct ServerConfig {
	1: optional i32 mediaSessionServicePort,
	2: optional i32 networkConnectionServicePort,
	3: optional i32 mixerServicePort,
}

service MediaServerService {
	/**
	 * Gets current server configuration that may be usefull for clients
	 */
	ServerConfig getServerconfig(),

	/**
	 * Creates a new mediaSession that allows interaction with media server
	 */
	mediaSession.MediaSession createMediaSession() throws (1: common.MediaServerException mse),

	/**
	 * Deletes a previously created media session.
	 */
	void deleteMediaSession(1: mediaSession.MediaSession session) throws (1: mediaSession.MediaSessionNotFoundException msnfe),
}


service CalculatorService {
  string say_hello(1: string name),
  i32 add(1: i32 value1, 2: i32 value2),
  double divide(1: i32 dividend, 2: i32 divisor),
  void ping()
}

Add exception to .thrift file

exception DivideByZeroException {
  1: string message
}

service CalculatorService {
  string say_hello(1: string name),
  i32 add(1: i32 value1, 2: i32 value2),
  double divide(1: i32 dividend, 2: i32 divisor)
    throws (1: DivideByZeroException),
  void ping()
}


# Copyright: (C) 2016 iCub Facility - Istituto Italiano di Tecnologia
# Authors: Claudio Fantacci
#
# idl_mesh.thrift

/**
 * iCubProprioceptionOGLIDL
 *
 * IDL Interface to \ref iCubProprioception OpenGL services.
 */

service iCubProprioceptionOGLIDL
{
    /**
     * View or hide background image of the mesh window.
     * @param status true/false to turn background on/off.
     * @return true activation/deactivation success, false otherwise.
     */
    bool mesh_background(1:bool status);

    /**
     * Render the mesh as a wireframe. If disabled (default behaviour)
     * the mesh is filled without light.
     * @param status true/false to turn wireframe rendering on/off.
     * @return true activation/deactivation success, false otherwise.
     */
    bool mesh_wireframe(1:bool status);
}

Add new sync_input() Thrift service with documentation

# Copyright: (C) 2016 iCub Facility - Istituto Italiano di Tecnologia
# Authors: Claudio Fantacci
#
# idl_mesh.thrift

/**
 * iCubProprioceptionOGLIDL
 *
 * IDL Interface to \ref iCubProprioception OpenGL services.
 */

service iCubProprioceptionOGLIDL
{
    /**
     * View or hide background image of the mesh window.
     *
     * @param status true/false to turn background on/off.
     *
     * @return true activation/deactivation success, false otherwise.
     */
    bool mesh_background(1:bool status);

    /**
     * Render the mesh as a wireframe. If disabled (default behaviour)
     * the mesh is filled without light.
     *
     * @param status true/false to turn wireframe rendering on/off.
     *
     * @return true activation/deactivation success, false otherwise.
     */
    bool mesh_wireframe(1:bool status);

    /**
     * Synchronize rendering FPS to the input rate of the poses received from
     * the ports.
     *
     * If the synchronization is off, then the last received pose is used by
     * the rendered (pose lock).
     *
     * @param status true/false to turn synchronization on/off.
     *
     * @return true activation/deactivation success, false otherwise.
     */
    bool sync_input(1:bool status);
}


/*
 * (C) Copyright 2013 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */

namespace java com.kurento.kms.thrift.api
namespace cpp kurento
namespace * Kurento

/**
 * HttpEndPoint extends MediaSessionEndPoint
 *
 * Constructors:
 * HttpEndPoint ();
 * HttpEndPoint (KmsMediaHttpEndPointConstructorParams);
 * HttpEndPoint (KmsMediaHttpEndPointConstructorParams, KmsMediaObjectConstructorParams);
 * HttpEndPoint (KmsMediaObjectConstructorParams);
 */
const string TYPE_NAME = "HttpEndPoint";

const string CONSTRUCTOR_PARAMS_DATA_TYPE = "KmsMediaHttpEndPointConstructorParams";

struct KmsMediaHttpEndPointConstructorParams {
  2: optional i32 disconnectionTimeout
}

/* METHODS */

/**
This method requests an HttpEndPoint to provide its associated URL.

String getUrl ();
*/
const string GET_URL = "getUrl";

Add option to indicate if a HttpEndPoint is live or not

/*
 * (C) Copyright 2013 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */

namespace java com.kurento.kms.thrift.api
namespace cpp kurento
namespace * Kurento

/**
 * HttpEndPoint extends MediaSessionEndPoint
 *
 * Constructors:
 * HttpEndPoint ();
 * HttpEndPoint (KmsMediaHttpEndPointConstructorParams);
 * HttpEndPoint (KmsMediaHttpEndPointConstructorParams, KmsMediaObjectConstructorParams);
 * HttpEndPoint (KmsMediaObjectConstructorParams);
 */
const string TYPE_NAME = "HttpEndPoint";

const string CONSTRUCTOR_PARAMS_DATA_TYPE = "KmsMediaHttpEndPointConstructorParams";

struct KmsMediaHttpEndPointConstructorParams {
  2: optional i32 disconnectionTimeout
  3: optional bool live
}

/* METHODS */

/**
This method requests an HttpEndPoint to provide its associated URL.

String getUrl ();
*/
const string GET_URL = "getUrl";