{"id":20051837,"url":"https://github.com/platform-system-interface/thead_cpuinfo","last_synced_at":"2025-03-02T08:42:31.320Z","repository":{"id":238358783,"uuid":"796389677","full_name":"platform-system-interface/thead_cpuinfo","owner":"platform-system-interface","description":"Decode CPU information for T-Head RISC-V cores","archived":false,"fork":false,"pushed_at":"2024-05-05T19:47:44.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T21:07:28.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/platform-system-interface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-05T19:41:59.000Z","updated_at":"2024-08-11T15:59:28.000Z","dependencies_parsed_at":"2024-05-05T20:50:37.813Z","dependency_job_id":null,"html_url":"https://github.com/platform-system-interface/thead_cpuinfo","commit_stats":null,"previous_names":["orangecms/thead_cpuinfo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platform-system-interface%2Fthead_cpuinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platform-system-interface%2Fthead_cpuinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platform-system-interface%2Fthead_cpuinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platform-system-interface%2Fthead_cpuinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/platform-system-interface","download_url":"https://codeload.github.com/platform-system-interface/thead_cpuinfo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241482034,"owners_count":19969847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T12:06:18.095Z","updated_at":"2025-03-02T08:42:31.276Z","avatar_url":"https://github.com/platform-system-interface.png","language":"Rust","readme":"# T-Head cpuinfo\n\nThis is a simple CPU information decoder for T-Head cores.\n\nDetailed information is not available regarding model etc. (`CPUINFO0`).\n\nPer the [C906 manual](https://github.com/T-head-Semi/openc906/tree/main/doc):\n\n\u003e The machine mode processor model register (MCPUID) stores the processor\n\u003e model information. Its reset value is determined by the product itself and\n\u003e complies with the Pingtouge product definition specifications to facilitate\n\u003e software identification. By continuously reading the MCPUID register, up to\n\u003e 7 different return values can be obtained to represent C906 product\n\u003e information, as shown in Figure ??.\n\n(translated by Google)\n\nTo read out the register, RISC-V CSR `0xfc0`:\n\n```rs\n/// T-Head CPU model register\nfn print_cpuid() {\n    let mut id: u32;\n    for i in 0..7 {\n        unsafe { asm!(\"csrr {}, 0xfc0\", out(reg) id) };\n        println!(\"MCPUID {i}: {id:08x}\");\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatform-system-interface%2Fthead_cpuinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplatform-system-interface%2Fthead_cpuinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatform-system-interface%2Fthead_cpuinfo/lists"}