stages:
  - build
  - test
  - deploy

build_rtl:
  stage: build
  script:
    - make build

test_alu:
  stage: test
  before_script:
    - make build library=alu_lib
  script:
    - make alu library=alu_lib
    - vcover-10.6 report alu.ucdb

test_fifo:
  stage: test
  before_script:
    - make build library=fifo_lib
  script:
    - make fifo library=fifo_lib
    - vcover-10.6 report fifo.ucdb

test_scoreboard:
  stage: test
  before_script:
    - make build library=scoreboard_lib
  script:
    - make scoreboard library=scoreboard_lib
    - vcover-10.6 report scoreboard.ucdb

test_dcache_arbiter:
  stage: test
  before_script:
    - make build library=dcache_arbiter_lib
  script:
    - make dcache_arbiter library=dcache_arbiter_lib
    - vcover-10.6 report dcache_arbiter.ucdb

test_store_queue:
  stage: test
  before_script:
    - make build library=store_queue_lib
  script:
    - make store_queue library=store_queue_lib
    - vcover-10.6 report store_queue.ucdb

test_core_asm:
  stage: test
  before_script:
    - git submodule update --init --recursive
    - make build-tests
    - make build library=core_lib
  script:
    - make run-asm-tests library=core_lib
    - vcover-10.6 report run-asm-tests.ucdb

# test with the randomized memory interfaces
test_core_asm_rand:
  stage: test
  before_script:
    - git submodule update --init --recursive
    - make build-tests
    - make build library=core_rand_lib
  script:
    # same as above but pass the rand_mem_if flag
    - make run-asm-tests library=core_rand_lib uvm-flags=+rand_mem_if
    - vcover-10.6 report run-asm-rand-tests.ucdb

test_failed_tests:
  stage: test
  before_script:
    - git submodule update --init --recursive
    - make build library=failed_tests_lib
  script:
    - make run-failed-tests library=failed_tests_lib
    - vcover-10.6 report run-failed-tests.ucdb

# test_lsu:
#   stage: test
#   before_script:
#     - make build library=lsu_lib
#   script:
#     - make lsu library=lsu_lib
#     - vcover-10.6 report lsu.ucdb
#     - vcover-10.6 report -html lsu.ucdb
#   artifacts:
#     paths:
#       - covhtmlreport


pages:
  stage: deploy
  dependencies:
    - build_rtl
  script:
    - mkdir public
    - mkdocs build -d public
    # - mv covhtmlreport/ public/
    # - lftp -e "mirror -R public . ; quit;" -u $FTP_USER,$FTP_PASSWORD $FTP_HOST
  artifacts:
    paths:
      - site


