gpu: nvgpu: create common sim unit

Move all simulation related code to common sim unit.
Moved common/sim.c -> common/sim/sim.c
      common/sim_pci.c -> common/sim/sim_pci.c

Also moved sim netlist related functionality also here. Because, sim
related code is not part of safety build and it will work as single
place-holder for all sim related code.
common/netlist/netlist_sim.c -> common/sim/sim_netlist.c

Changed function name for initializing sim netlist context vars and
moved it to sim.h from netlist.h
nvgpu_netlist_init_ctx_vars_sim -> nvgpu_init_sim_netlist_ctx_vars

JIRA NVGPU-2078

Change-Id: Ibe3452d1595ebd8cc08ce7bd186fdf4291e40ca6
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2100605
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seshendra Gadagottu
2019-04-18 09:47:44 -07:00
committed by mobile promotions
parent 9b12f99534
commit b716286e0f
8 changed files with 11 additions and 10 deletions

View File

@@ -74,7 +74,6 @@ nvgpu-y += \
common/gr/obj_ctx.o \
common/gr/fs_state.o \
common/netlist/netlist.o \
common/netlist/netlist_sim.o \
common/init/nvgpu_init.o \
common/pmu/pmu.o \
common/pmu/pmu_allocator.o \
@@ -483,8 +482,9 @@ nvgpu-y += \
common/power_features/power_features.o \
common/power_features/cg/cg.o \
common/power_features/pg/pg.o \
common/sim.o \
common/sim_pci.o \
common/sim/sim.o \
common/sim/sim_pci.o \
common/sim/sim_netlist.o \
common/rc/rc.o \
common/fifo/fifo.o \
common/fifo/channel.o \

View File

@@ -58,8 +58,9 @@ srcs += os/posix/bug.c \
os/posix/os_sched.c \
os/posix/kmem.c
srcs += common/sim.c \
common/sim_pci.c \
srcs += common/sim/sim.c \
common/sim/sim_pci.c \
common/sim/sim_netlist.c \
common/init/nvgpu_init.c \
common/mm/allocators/nvgpu_allocator.c \
common/mm/allocators/bitmap_allocator.c \
@@ -119,7 +120,6 @@ srcs += common/sim.c \
common/gr/obj_ctx.c \
common/gr/fs_state.c \
common/netlist/netlist.c \
common/netlist/netlist_sim.c \
common/pmu/pmu.c \
common/pmu/pmu_allocator.c \
common/pmu/pmu_mutex.c \

View File

@@ -21,6 +21,7 @@
*/
#include <nvgpu/nvgpu_common.h>
#include <nvgpu/sim.h>
#include <nvgpu/kmem.h>
#include <nvgpu/log.h>
#include <nvgpu/firmware.h>
@@ -512,7 +513,7 @@ int nvgpu_netlist_init_ctx_vars(struct gk20a *g)
}
if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
return nvgpu_netlist_init_ctx_vars_sim(g);
return nvgpu_init_sim_netlist_ctx_vars(g);
} else {
return nvgpu_netlist_init_ctx_vars_fw(g);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,7 +25,7 @@
#include <nvgpu/netlist.h>
#include <nvgpu/log.h>
int nvgpu_netlist_init_ctx_vars_sim(struct gk20a *g)
int nvgpu_init_sim_netlist_ctx_vars(struct gk20a *g)
{
struct nvgpu_netlist_vars *netlist_vars = g->netlist_vars;
int err = -ENOMEM;

View File

@@ -209,7 +209,6 @@ struct nvgpu_netlist_vars {
};
int nvgpu_netlist_init_ctx_vars(struct gk20a *g);
int nvgpu_netlist_init_ctx_vars_sim(struct gk20a *g);
void nvgpu_netlist_deinit_ctx_vars(struct gk20a *g);
struct netlist_av_list *nvgpu_netlist_get_sw_non_ctx_load_av_list(

View File

@@ -56,5 +56,6 @@ void nvgpu_free_sim_support(struct gk20a *g);
void nvgpu_remove_sim_support(struct gk20a *g);
void sim_writel(struct sim_nvgpu *sim, u32 r, u32 v);
u32 sim_readl(struct sim_nvgpu *sim, u32 r);
int nvgpu_init_sim_netlist_ctx_vars(struct gk20a *g);
#endif /* NVGPU_SIM_H */