-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcert_flow.txt
82 lines (80 loc) · 2.83 KB
/
cert_flow.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
backends/certificate_doc/tasks.rake
bootstrap_cfg_arch = cfg_arch_for("rv#{base}") # rv32 or rv64
Rakefile
Calls ConfiguredArchitecture.new("gen/resolved_arch/rv32")
Calls Architecture.new # Parent class
Calls Config.create("cfgs/rv32/cfg.yaml") # Factory class method
Loads config yaml file into @data # File specifies if fully, partially, or unconfigured
Calls PartialConfig.new(cfg path, @data) # Uses Ruby send() method
@mxlen = @data["params"].xlen
@name = "rv32"
bootstrap_cert_model = bootstrap_cfg_arch.cert_model(cert_model_name = "MC100-32")
Calls self.generate_obj_methods("cert_model", "certificate_model", CertModel) in Architecture # Magic
Calls define_method("cert_model")
Calls define_method("cert_models")
Creates @cert_models array and @cert_model_hash # Per arch_dir
For every certificiate model in the database
Loads yaml under gen/resolved_arch/rv32 into @cert_models hash
Calls cert_model.new() -> DatabaseObject.initialize(yaml, yaml_path, arch=base_cfg_arch)
@data = yaml
@arch = arch # rv32
cfg_arch = bootstrap_cert_model.to_cfg_arch # In Portfolio class
Creates hash with mandatory extensions (with version requirement) and fully-constrained params (single_value?)
Uses in_scope_ext_reqs() and all_in_scope_ext_params() in Portfolio
Writes hash to yaml file in /tmp/.../MC100-32/cfg.yaml
Passes yaml file to ConfiguredArchitecture.new()
Creates Architecture (base class), Config, and PartialConfig again (see above)
cert_model = cfg_arch.cert_model(cert_model_name)
Creates CertModel for every model in the database and stores it in the real ConfiguredArchitecture object
Calls ERB template
Converts ERB result to ASCIIDOC
==============================================================================================
Actual rv32/cfg.yaml
---
$schema: config_schema.json#
kind: architecture configuration
type: partially configured
name: rv32
description: A generic RV32 system; only MXLEN is known
params:
XLEN: 32
mandatory_extensions:
- name: "I"
version: ">= 0"
- name: "Sm"
version: ">= 0"
===============================================================================================
Bootstrap /tmp/.../MC100-32/cfg.yaml
---
"$schema": config_schema.json
type: partially configured
kind: architecture configuration
name: MC100-32
description: A partially configured architecture definition corresponding to the MC100-32
portfolio.
mandatory_extensions:
- name: I
version:
- "~> 2.1"
- name: C
version:
- "~> 2.2"
- name: M
version:
- "~> 2.0"
- name: Zicsr
version:
- "~> 2.0"
- name: Zicntr
version:
- "~> 2.0"
- name: Sm
version:
- "~> 1.11.0"
params:
MISALIGNED_SPLIT_STRATEGY: by_byte
PRECISE_SYNCHRONOUS_EXCEPTIONS: true
TRAP_ON_ECALL_FROM_M: true
TRAP_ON_EBREAK: true
M_MODE_ENDIANESS: little
XLEN: 32